[swift-evolution] [Proposal] Property behaviors

Zach Waldowski zach at waldowski.me
Tue Jan 26 17:28:48 CST 2016


Or with the anonymous self-calling closure dance.

On Tue, Jan 26, 2016, at 02:40 PM, Jacob Bandes-Storch via swift-evolution wrote:
> On Tue, Jan 26, 2016 at 9:14 AM, Joe Groff via swift-evolution <swift-
> evolution at swift.org> wrote:
>>
>> `lazy var`s still can't refer to self today AFAIK (I know we tried to
>> fix that, but we still get plenty of radars saying it doesn't work…),
>> so I don't think it would be a regression for a behavior
>> implementation not to immediately be able to either. (And I'm not
>> proposing we immediately replace our existing 'lazy' implementation
>> immediately either.)
>>
>
> They can; it just requires a type annotation.
>
> class C {    lazy var b: B = B(c: self) }
>
> struct B {    let c: C }
> _________________________________________________
> swift-evolution mailing list swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160126/0155ebca/attachment.html>


More information about the swift-evolution mailing list