[swift-evolution] [Proposal] Property behaviors

Joe Groff jgroff at apple.com
Wed Jan 13 17:14:40 CST 2016


> On Jan 13, 2016, at 2:37 PM, Tal Atlas <me at tal.by> wrote:
> 
> For var [lazy] foo = 1738 how does the user or compiler know that foo, even though it’s an Int, it has a property called `lazy` on it.

If name lookup has visibility of the behaviors, it can handle them as a special case.

> And what happens if that object type has a property named `lazy` already?

Good question. We can either overload the name and let type context sort it out, or consider an alternative syntax for accessing members.

-Joe


More information about the swift-evolution mailing list