<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div>Am 12.12.2015 um 20:08 schrieb Joe Groff &lt;<a href="mailto:jgroff@apple.com">jgroff@apple.com</a>&gt;:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 12, 2015, at 10:58 AM, Thorsten Seitz &lt;<a href="mailto:tseitz42@icloud.com" class="">tseitz42@icloud.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 12.12.2015 um 19:01 schrieb Joe Groff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">(T | T | U | V) and (U | T | V) would be distinct types</span></div></blockquote></div><br class=""><div class="">That would be unexpected. I’d expect them to be the same type.</div><div class=""><br class=""></div><div class="">In Ceylon I can do the following without problems:</div><div class=""><pre style="background-color: rgb(255, 255, 255); font-family: Menlo;" class=""><span style="color:#990066;" class="">String</span>|<span style="color:#990066;" class="">String</span>|<span style="color:#990066;" class="">Integer </span>foo = <span style="color:#0000ff;" class="">1</span>;<br class=""><span style="color:#990066;" class="">Integer</span>|<span style="color:#990066;" class="">String </span>bar = foo;</pre><div class="">or</div></div><div class=""><pre style="background-color: rgb(255, 255, 255); font-family: Menlo;" class=""><span style="color:#000080;font-weight:bold;" class="">interface </span><span style="color:#990066;" class="">Parent </span>{}<br class=""><span style="color:#000080;font-weight:bold;" class="">interface </span><span style="color:#990066;" class="">ChildA </span><span style="color:#000080;font-weight:bold;" class="">satisfies </span><span style="color:#990066;" class="">Parent </span>{}<br class=""><span style="color:#000080;font-weight:bold;" class="">interface </span><span style="color:#990066;" class="">ChildB </span><span style="color:#000080;font-weight:bold;" class="">satisfies </span><span style="color:#990066;" class="">Parent </span>{}<br class=""><pre style="font-family: Menlo;" class=""><pre style="font-family: Menlo;" class=""><span style="color:#990066;" class="">ChildA </span>a = childA();<br class=""><span style="color:#990066;" class="">ChildB </span>b = childB();<br class=""><span style="color:#990066;" class="">Parent </span>p1 = a;<br class=""><span style="color:#990066;" class="">ChildA|Parent </span>p2 = b;<br class=""><span style="color:#990066;" class="">Parent </span>p3 = <span style="color:#000080;font-weight:bold;" class="">if </span>(x) <span style="color:#000080;font-weight:bold;" class="">then </span>a <span style="color:#000080;font-weight:bold;" class="">else </span>b;</pre><div class=""><div style="font-family: Helvetica; white-space: normal;" class="">Everything fits nicely as expected.</div></div></pre></pre></div></div></div></blockquote></div><div>I agree, but making this work massively complicates the type system, as John noted.</div></div></blockquote><div><br></div>Certainly, but at the same time much more powerful!<div><br><div>And the Ceylon type system has recently been made available as a module with Apache 2 license, so it should be possible to check how they have solved problems (although I fear that Swift's non attribution license extension might be a problem here).</div><div><br></div><div>-Thorsten<br></div></div></body></html>