[swift-evolution] Proposal - Allow properties in Extensions

Nutchaphon Rewik nRewik at outlook.com
Wed Dec 23 06:33:37 CST 2015

I agree. I think stored properties in extensions should only be visible in its scope. If we combine the idea with scope access modifier ( https://github.com/apple/swift-evolution/pull/64 ). We can make the rule that no stored property is allowed to expose from its extension.


From: Tino Heth <2th at gmx.de>
Sent: Wednesday, December 23, 2015 6:42 PM
To: Nutchaphon Rewik
Cc: kevyk at mac.com; swift-evolution at swift.org
Subject: Re: [swift-evolution] Proposal - Allow properties in Extensions


When the extension is in the same module, it's nice to be able to group all aspects of an extension in one place instead of being forced to declare properties in the definition.
But I guess the most important use case is to extend types that aren't in the same module, and I wouldn't like to see that hacking the runtime becomes a common thing to do.


More information about the swift-evolution mailing list