final class First {
    let item: First
    init(item: First) {
        self.item = item
    }
}

extension First {
    convenience init() {
        self.init(item: self)
    }
}

let a = First()

I'm actually a bit surprised that this compiles.
This should be diagnosed as: "error: 'self' used before self.init call" I
think.


2017-03-13 23:42 GMT+09:00 Dimitri Racordon <[email protected]>:

> But then!
>
> The following still shouldn’t compile:
>
> final class First {
>     let item: First
>     init(item: First) {
>         self.item = item
>     }
> }
>
>
>
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to