[swift-evolution] [Oversight] Reference types allow mutating methods through generics

David Sweeris davesweeris at mac.com
Wed May 4 13:21:32 CDT 2016

> On May 4, 2016, at 11:12, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> I can see value in there being some kind of PureValue protocol, for types that represent fully self-contained values, but conforming to that protocol requires a bit more thought than just being a struct or enum, since there are structs that have reference semantics (such as UnsafePointer), and there are hybrid value types that contain references to data that isn't part of the value (an Array<Class>, for instance).
> -Joe


I'd think that both "PureValue" and "PureReference" would be useful. Isn't it the mixed types that make for tricky mutation rules & serialization?

More information about the swift-evolution mailing list