<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div><br>On Jun 5, 2016, at 9:47 PM, Pyry Jahkola via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">I would prefer the type to be simple, and be implemented as a case-less enum (not a bottom value, as in Haskell).<br class=""></div><div class=""><br class=""></div><div class="">None should be a usual enum, with no compiler magic except that functions returning None are equivalent to current @noreturn.</div></div></div></blockquote></div><br class=""><div class="">I think it would be more useful if the compiler allowed `<font face="Menlo" class="">Never</font>` in every type context (i.e. whatever type `<font face="Menlo" class="">T</font>` was expected, an expression of type `<font face="Menlo" class="">Never</font>` would be allowed), making expressions like the following compile:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class=""> let unwrapped: Int = optional ?? fatalError("explanation why this must not happen")</font></div><div class=""><br class=""></div><div class="">— Pyry</div></div></div></blockquote><br class=""></div>I dunno, I think @noreturn is clearer than any of these. It tells you that the function… won’t return. None, Never, etc. could be mistaken as a synonym for Void, whereas @noreturn is pretty hard to miss.</div></blockquote><br class=""></div><div>FWIW, in the <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160530/019879.html" class="">rejection of SE-0097</a>, this was what the core team had to say about it:</div><div><br class=""></div><div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div class=""><i class="">1) For noreturn, the core team prefers to explore a solution where a function can be declared as returning an non-constructable “bottom” type (e.g. an enum with zero cases). This would lead to something like:</i></div></div><div><div class=""><i class=""><br class=""></i></div></div><div><div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre">        </span>func abort() -> NoReturn { … }</i></div></div></blockquote></div></blockquote><div><br></div><div>Interesting... There are other cases that would exist for which NoReturn seems the wrong name... but they knwo better I guess.</div><div><br></div><br><blockquote type="cite"><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div class=""><i class=""><br class=""></i></div></div><div><div class=""><i class="">This will require some new support in the compiler, but should flow better through the type system than @noreturn in function composition and other applications. Joe Groff offered to write a proposal for this.</i></div></div></blockquote><div class=""><br class=""></div><div class="">— Pyry</div><div class=""><br class=""></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>