Re: [swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-07 Thread Jens Persson via swift-users
Ok, thanks! On Wed, Jun 7, 2017 at 4:52 PM, Karl Wagner wrote: > > On 7. Jun 2017, at 11:29, Jens Persson via swift-users < > swift-users@swift.org> wrote: > > I see, this quote from the introduction of SE-0142 is not to be taken > literally then: > > For example, the

Re: [swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-07 Thread Karl Wagner via swift-users
> On 7. Jun 2017, at 11:29, Jens Persson via swift-users > wrote: > > I see, this quote from the introduction of SE-0142 is not to be taken > literally then: > > For example, the SequenceType protocol could be declared as follows if the > current proposal was

Re: [swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-07 Thread Jens Persson via swift-users
I see, this quote from the introduction of SE-0142 is not to be taken literally then: For example, the SequenceType protocol could be declared as follows if the current proposal was accepted: protocol Sequence { associatedtype Iterator : IteratorProtocol associatedtype SubSequence :

Re: [swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-07 Thread Slava Pestov via swift-users
> On Jun 7, 2017, at 12:46 AM, Jens Persson wrote: > > Ok, I thought it was part of SE-0142 (which has status "implemented (Swift > 4)”. That’s just the where clause part. There’s still plenty you can accomplish with them even if they do not introduce recursive

Re: [swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-07 Thread Jens Persson via swift-users
Ok, I thought it was part of SE-0142 (which has status "implemented (Swift 4)". /Jens On Wed, Jun 7, 2017 at 9:39 AM, Slava Pestov wrote: > This is a rather complex feature that is not actually implemented in Swift > 4 (or Swift 3 for that matter). Work is underway to support

Re: [swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-07 Thread Slava Pestov via swift-users
This is a rather complex feature that is not actually implemented in Swift 4 (or Swift 3 for that matter). Work is underway to support this, though. The fact that the second example does not produce a diagnostic is a bug (probably you will not be able to define a type that conforms to P2

[swift-users] Swift 4 protocol with associatedtype conforming to itself

2017-06-06 Thread Jens Persson via swift-users
In Swift 4: protocol P1 { associatedtype A: P1 // Error: Type may not reference itself as a requirement } protocol P2 { associatedtype A where A: P2 // OK } What is the rationale behind this? /Jens ___ swift-users mailing list