Re: [swift-users] How to use a protocol to infer a generic type with constraints

2017-05-02 Thread Howard Lovatt via swift-users
Another +1 from me, a real pain -- Howard. > On 3 May 2017, at 4:05 am, David Sweeris via swift-users > wrote: > > >> On May 2, 2017, at 10:16 AM, Edward Connell via swift-users >> wrote: >> >> Does anyone have an idea when this is going to be fixed? Or when support >> will be implemented

Re: [swift-users] How to use a protocol to infer a generic type with constraints

2017-05-02 Thread David Sweeris via swift-users
> On May 2, 2017, at 10:16 AM, Edward Connell via swift-users > wrote: > > Does anyone have an idea when this is going to be fixed? Or when support will > be implemented? > My app heavily uses collections of heterogenous plug-ins, so it's a real pain > in the neck to work around. My understa

Re: [swift-users] How to use a protocol to infer a generic type with constraints

2017-05-02 Thread Edward Connell via swift-users
Does anyone have an idea when this is going to be fixed? Or when support will be implemented? My app heavily uses collections of heterogenous plug-ins, so it's a real pain in the neck to work around. On Tue, May 2, 2017 at 2:08 AM, Satoshi Nakagawa via swift-users < swift-users@swift.org> wrote:

Re: [swift-users] How to use a protocol to infer a generic type with constraints

2017-05-02 Thread Satoshi Nakagawa via swift-users
Hi Slava, Thanks for your quick response! I see. That's in line with what I can read from the Type Constraint Syntax section in the official Swift book. Satoshi On Tue, May 2, 2017 at 1:59 AM, Slava Pestov wrote: > Hi Satoshi, > > Protocols do not conform to themselves. Only concrete types c

Re: [swift-users] How to use a protocol to infer a generic type with constraints

2017-05-02 Thread Slava Pestov via swift-users
Hi Satoshi, Protocols do not conform to themselves. Only concrete types can conform to protocols in the current implementation of Swift. Slava > On May 2, 2017, at 1:57 AM, Satoshi Nakagawa via swift-users > wrote: > > Hi, > > I got a build error "Generic parameter 'T' could not be inferred

[swift-users] How to use a protocol to infer a generic type with constraints

2017-05-02 Thread Satoshi Nakagawa via swift-users
Hi, I got a build error "Generic parameter 'T' could not be inferred" for the following code. Can anyone explain why we can't use a protocol to infer the generic type T? class Emitter { func emit() -> T { ... } } protocol Emittable {} protocol Subemittable: Emitable {} class Co