[swift-evolution] [Pitch] Update to Alternative Types (i.e. strong typedef) Proposal

Daryle Walker darylew at mac.com
Sat Jul 29 18:01:47 CDT 2017

Proposal at <https://gist.github.com/CTMacUser/c493f775075e946efdcfd85d38473291>, uploaded revision 4.


Since the original setup was a poor copy of how raw-style enumerations use RawRepresentable, changed the model to actually use RawRepresentable. Actually, it uses a sub-protocol, AnyAlternative, which adds an associated type for the implementing non-alternative type. AnyAlternative also serves a function like AnyObject.
Removed the old library support type since it’s obsolete. Added back a (now global) function to upcast to the implementation type without needing to name it.
Added option to initialize alternative by assigning to “super.” Using “super” by itself isn’t allowed in the grammar (It has to be followed by a member specification), so I added it.
Added note about pointer compatibility.
The model change led to a lot of rewording. And new/changed technical terms.

Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170729/fa314c05/attachment.html>

More information about the swift-evolution mailing list