[Second review] SE-0390: Noncopyable structs and enums

AnyObject is a typealias to Builtin.AnyObject, but that is immaterial really—the question is what it aliases.

Both AnyObject and Copyable are layout constraints, the only official ones in the language, and as the documentation for AnyObject makes clear ("The protocol to which all classes implicitly conform"), they are presented in the surface language as bona fide protocols. Semantically, it does not make sense to allow retroactive conformances to a layout constraint of course. BitwiseCopyable (however it is eventually named) as envisioned would follow this precedent.

It would be unfortunate to make any decisions here that are based on the notion that there is something different about Copyable than other protocols. I doubt we would want to take a different approach with ~Copyable than with, say, ~Equatable, ~Hashable (for enums that currently implicitly conform).

10 Likes