swift - Provide concrete type for Generic Protocol implementation -


is possible following:

protocol a: class {     typealias t: anyobject } extension {     func testa(a:self, _ t:t)->void{         print(a, t)     } } class b:a {     typealias t = string } 

in other words have protocol , want provide concrete type in class conforms it.

that should fine. issue code have there string not anyobject.

you need:

protocol a: class {     typealias t } extension {     func testa(a:self, _ t:t)->void{         print(a, t)     } } class b:a {     typealias t = string } 

Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -