I have issue with following code:
func generic1(name : String){
}
func generic2(name : String){
generic1(name)
}
I had a similar problem with my generic class function class func retrieveByKey.
I could not call it let a = retrieveByKey where Categories is a subclass of GrandLite.
let a = Categories.retrieveByKey(key:"abc") returned GrandLite, not Categories. Generic functions do not infer type based on the class that calls them.
class func retrieveByKey gave me an error when I tried let a = Categories.retrieveByKey(aType: Categories, key: "abc") gave me an error that it could not convert Categories.Type to GrandLite, even though Categories is a subclass of GrandLite. HOWEVER...
class func retrieveByKey did work if I tried let a = Categories.retrieveByKey(aType: [Categories](), key: "abc") apparently an explicit assignment of a subclass does not work, but an implicit assigment using another generic type (array) does work in Swift 3.