[swift-evolution] Thoughts on property behavior out-of-band members

Brent Royal-Gordon brent at architechies.com
Fri Feb 19 19:42:27 CST 2016

> If we went this way, I wonder how we would deal with name spacing when we add behavior composition. That is, if two behaviors define members with the same name, how would we disambiguate between the members at the usage site? 

It's a fair question. One possibility is make the `foo. at runcible` format available, but only in private scope with no way to widen it. The type applying the property would then be able to define a `resetFoo()` method which called whichever version it wanted to expose.

(In theory, you could do this for *all* members exposed on a behavior, and require the applying type to define cover members for whatever it wanted to expose. I don't like that idea, though; I think that would add a burdensome amount of boilerplate.)

Brent Royal-Gordon

More information about the swift-evolution mailing list