[swift-users] Still can't derive from a generic class

Joanna Carter joanna at carterconsulting.org.uk
Tue Aug 29 12:25:57 CDT 2017


Hi Jon

> Le 29 août 2017 à 19:20, Jon Shier <jon at jonshier.com> a écrit :
> 
> This works fine for me in a playground in the latest Xcode 9 beta:
> 
> class Test { }
> 
> class Base<T: AnyObject> { }
> 
> class Sub: Base<Test> { }
> 
> let sub = Sub()

That may well work but what I want is to be able to do is simpler than that :

class Base<T : AnyObject> { }

class Test : Base<Test> { }

let test = Test()


Joanna

--
Joanna Carter
Carter Consulting



More information about the swift-users mailing list