title: Cannot convert return expression of type '[Favorite.Type]' to return type '[Favorite]'
body: <p>I want to make a general function for getting Elements from UserDefaults that are conforming to the NSObject and NSCoding Protocol. But when I want to use that function I get this error         </p>
  
  <pre><code>    func getFavorites() -&gt; [Favorite] {
          return get(type: Favorite, forKey: UD_FAVORITES)
      }
  </code></pre>
  
  <blockquote>
    <p>Cannot convert return expression of type '[Favorite.Type]' to return type '[Favorite]'</p>
  </blockquote>
  
  <p>That's my UserDefaults Extension:</p>
  
  <pre><code>    func get&lt;T&gt;(type: T, forKey key: String) -&gt; [T] {
          if let data = self.object(forKey: key) as? Data {
              do {
                  let tData = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! [T]
                  return tData
              } catch {
                  debugPrint(error)
                  return [T]()
              }
          } else {
              print("EMPTY \(key)")
              return [T]()
          }
      }
  </code></pre>