<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>I don't expect interference to lead to bugs because everything is strongly typed and you would wonder when the compile or IDE tells you that your variable or function should have type Int | String.</div><div><br></div><div>But requiring the result type of a conditional to be explicitly typed I could live with if I just get union types :-)</div><div><br></div><div>-Thorsten</div><div><br>Am 12.12.2015 um 20:11 schrieb Matthew Johnson <<a href="mailto:matthew@anandabits.com">matthew@anandabits.com</a>>:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">I don’t have any experience working in a language with structural sum types but I think inference of structural sums in different branches of a conditional would lead to a lot of bugs and potential confusion. Before considering support of such inference I would want to see pretty compelling evidence that it adds value and doesn’t lead to problems.</div><div class=""><br class=""></div><div class="">In absence of allowing this inference, the structural sum could be specified manually if that is what is intended.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 12, 2015, at 12:48 PM, Thorsten Seitz via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> 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=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 10.12.2015 um 20:59 schrieb John McCall via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:</div><div class=""><div style="" class=""><br 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;" 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="">Also, are we allowed to *infer* structural sums? For example, can we decide that the type of (x ? A() : B()) is A+B if that’s the greatest common type? </span></div></div></blockquote><div class=""><br class=""></div>That’s what Ceylon does.</div><div class=""><br class=""></div></div><div class="">-Thorsten</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eLFMrKDT8iBxZ-2Fbnk-2BZqvSchNN-2FvYXdceA0T7VxwkAd-2FvVbEurwkGNVkzgfItWy615W6UqffInB23gYTGn1cUuZgRiPwJVzCEMjNQdMj7q78HoPdAj96Z-2BoD8O65Hl1NJB4l79HKR5XfYzghCCFsJQ-2FFseB4xRaeTMn3IVq2wMEgtmV5kTPzWKgEIl0CnyLnBFEKsx0ZN5UEa3UR1UFm-2B8AmNEg5Sjh7S5agUmK8R9o-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></body></html>