<div dir="ltr">Union types are to enums as tuples are to structs. There's room for both in the language. Sometimes it makes sense to have a more formalized construct that has specific semantics (like an error type) and methods that operate upon that type. Sometimes, you just want an int OR a string.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 14, 2016 at 10:58 AM, Tino Heth via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> func f(obj: A&B&C) {..}<br>
> if obj is A&B&C {...}<br>
> obj2 = obj as! A&B&C<br>
><br>
> (but I still don't understand real use case of things like (String | Int))<br>
</span>Ceylon has already been mentioned: It uses the concept for its optionals.<br>
Swift uses enums, and those could be made obsolete by union types.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>