[swift-evolution] Proposal - Allow properties in Extensions

Matthew Johnson matthew at anandabits.com
Wed Dec 23 10:15:46 CST 2015

> On Dec 23, 2015, at 10:02 AM, Kevin Kachikian via swift-evolution <swift-evolution at swift.org> wrote:
> I don’t think hacking the runtime is much of an issue, more that it might already be now. 
> However part of the thinking behind the idea of extending extensions to encompass property declarations, above and beyond grouping related code together, is to maintain orthogonality: Structs and classes can declare properties and so should extensions to such types be able to as well.

The problem I think we need to consider carefully is that introducing stored properties is not necessarily orthogonal.  It can have significant impact on all initializers.

> Kevin
>> On Dec 23, 2015, at 3:42 AM, Tino Heth <2th at gmx.de> wrote:
>> +1/-1:
>> 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.
>> Tino
> _______________________________________________
> 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/20151223/c4972969/attachment.html>

More information about the swift-evolution mailing list