[swift-evolution] Pitch: Restrict Cross-module Struct Initializers
xiaodi.wu at gmail.com
Fri Oct 6 17:23:08 CDT 2017
Presumably, @_fixed_layout and its future formalized cousin would restore
the current functionality?
On Fri, Oct 6, 2017 at 16:32 Jordan Rose via swift-evolution <
swift-evolution at swift.org> wrote:
> While working on the non-exhaustive enums proposal I had it pointed out to
> me that *structs* actually currently leak implementation details across
> module boundaries, specifically their full set of stored properties. This
> only comes up in one place: when making an initializer for the struct in an
> extension in another module. We really want people to be able to change the
> stored properties in their structs between releases without it being a
> source break—that's half the point of computed properties—and it's also
> important for a struct author to be able to enforce invariants across the
> struct's properties. So after talking to a few other Apple Swift folks I
> put together this proposal:
> This one's way smaller than the enum one, and hopefully fairly
> uncontroversial. Feedback welcome!
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution