import UIKit protocol Identifiable { } protocol Storage { func test() -> Data<Identifiable> } class DiskStorage<T where T:Identifiable, T:NSCoding>:Storage { func test() -> Data<Identifiable> { return Data<T>() //error: T is not identical to Identifiable } } class Data<T where T:Identifiable> { }
I thought it would be possible to use a generic protocol type to invoke a method that references the same protocol. How to do it? I tried almost everything, nothing works. Maybe I understand something is wrong ...
Any help on this guy? Thank you very much
source share