title: Generic class inheritance in Swift
body: <p>I have the following class:</p>
  
  <pre><code>class BaseCache&lt;T: Equatable&gt;: NSObject {
  
      var allEntities = [T]()
  
      // MARK: - Append
  
      func appendEntities(newEntities: [T]) {
          ....
      }
  }
  </code></pre>
  
  <p>Now I want to subclass it, but I get annoying error, that my type "does not conform to protocol 'Equatable'":
  <img src="https://i.stack.imgur.com/9OYud.png" alt="enter image description here"></p>
  
  <p>It seems generics in Swift are real pain-in-the-ass.</p>