<div dir="ltr">Union types are to enums as tuples are to structs. There&#39;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">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
&gt; func f(obj: A&amp;B&amp;C) {..}<br>
&gt; if obj is A&amp;B&amp;C {...}<br>
&gt; obj2 = obj as! A&amp;B&amp;C<br>
&gt;<br>
&gt; (but I still don&#39;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>