Re: [swift-users] question on generics

2017-02-22 Thread Slava Pestov via swift-users
> On Feb 22, 2017, at 4:23 PM, David Sweeris via swift-users > wrote: > > >> On Feb 22, 2017, at 16:08, Dave Reed via swift-users >> wrote: >> >> I suspect this can't be done (at least not right now), but wanted to check. >> >> I'd like to

Re: [swift-users] question on generics

2017-02-22 Thread David Sweeris via swift-users
> On Feb 22, 2017, at 16:08, Dave Reed via swift-users > wrote: > > I suspect this can't be done (at least not right now), but wanted to check. > > I'd like to declare a class as a generic that meets a protocol and is also a > subclass of some specific type. > >

Re: [swift-users] question on generics

2017-02-22 Thread Kevin Nattinger via swift-users
This seems to work in a playground: import CoreData protocol SomeProtocol {} class Foo where T: SomeProtocol {} > On Feb 22, 2017, at 4:08 PM, Dave Reed via swift-users > wrote: > > I suspect this can't be done (at least not right now), but wanted to check. > > I'd

[swift-users] question on generics

2017-02-22 Thread Dave Reed via swift-users
I suspect this can't be done (at least not right now), but wanted to check. I'd like to declare a class as a generic that meets a protocol and is also a subclass of some specific type. Something like class Foo (i.e., the T must be both a NSManagedObject or