[swift-evolution] Pitch: Partial Implementations
Karl Wagner
razielim at gmail.com
Thu Mar 23 19:55:33 CDT 2017
> On 23 Mar 2017, at 21:36, Slava Pestov via swift-evolution <swift-evolution at swift.org> wrote:
>
>
>> On Mar 23, 2017, at 11:21 AM, Matthew Johnson via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>
>> 1) Allow stored properties in same-module extensions. This has been discussed in the past and is a possibility, but I suspect it is not in scope for consideration during Swift 4.
>
> Allowing stored properties and overridable methods in same-*file* extensions would be trivial to implement.
>
> Same-module extensions are still tricky to generalize because in non-WMO mode, the class (and its metadata, such as stored property layout and vtable) could be emitted in a different translation unit than the extension, so we’d have to ’stitch’ together the definitions somehow and deal with the lack of static knowledge of things like the size of the class and the virtual methods it defines.
>
> Slava
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
I think limiting it to same-file extensions should be enough to handle most cases. It’s good that it keeps it local to the original declaration, since it would affect things like implicit initialisers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170324/dbd58581/attachment-0001.html>
More information about the swift-evolution
mailing list