[swift-evolution] [Proposal] Property behaviors
2th at gmx.de
Wed Dec 23 14:57:45 CST 2015
Quite complex proposal… guess I'll read it a second time when I'm less tired, but I have already one idea for the feature:
> Syntax for accessing the backing property
When I saw the examples, I wondered right away "what if foo has an own property called runcible? How is the type modified to allow access to its backing property?" (that was my first interpretation on "foo.runcible")
I think all problems can be avoided without new keywords or a suffix with rarely used (or forbidden) character:
Just give the backing property for "foo" the name "super.foo".
- Afaik this is safe, because you can't create a property that already exists in the superclass (I guess it works if the property is not visible…)
- It's quite intuitive to me, because super always bypasses the normal behavior of self (well, commonly it refers to the superclass, but "bypass self" is just more general than superclass).
May the force be with you
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution