<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 7, 2016 at 2:49 PM, Michael Peternell 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; Am 07.06.2016 um 19:45 schrieb Charles Srstka via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;:<br>
&gt;<br>
&gt;&gt; On Jun 7, 2016, at 11:47 AM, Brent Royal-Gordon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; I disagree. We are discussing how to annotate a function in some way so that the compiler knows that the code following it will never be executed *and* so a human who reads the declaration knows that it does not return. “Never&quot; is a poor choice for that. Never what? Never return? Never use this function? Never say never again?<br>
&gt;&gt;<br>
&gt;&gt; &quot;Never return&quot;. That&#39;s why it&#39;s in the return type slot, right after the `-&gt;`. If you read it out loud, you&#39;ll read &quot;returns Never&quot;, which is exactly correct.<br>
&gt;&gt;<br>
&gt;&gt; NoReturn, on the other hand, does *not* read well in that slot: &quot;returns NoReturn&quot;. Huh? I mean, I suppose you won&#39;t misunderstand it, but it makes no sense whatsoever *as a type name*.<br>
&gt;<br>
&gt; But it’s *not* a type. You’ll never have an instance of it.</span></blockquote><div><br></div><div>That&#39;s the dictionary definition of a <a href="https://en.wikipedia.org/wiki/Bottom_type">bottom type</a>, though: a type which has no values.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Since it’s not a type name, it doesn’t make sense that it needs to look like one. What it is doing is telling you something about the behavior of the function itself, not its return value. Its return value, if there were one, is irrelevant, since the function, by its very nature, will never even get to the point where it would return it.</span></blockquote><div><br></div><div>And that&#39;s the dictionary definition of a function where the return type is bottom. This isn&#39;t something being made up just for Swift...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Either it’s going to kill the app via a fatalError or something, or we have something like dispatch_main() which will keep executing until the program stops, and one way or another, it won’t return.<br>
&gt;<br>
&gt; For that reason, frankly, I don’t understand why we want to change this from being an attribute, which seems to me the more natural and logical choice to describe this behavior. If we *do* have to change it, though, NoReturn conveys the most clearly to the reader what it does.<br>
<br>
</span>+1 for @noreturn<br>
We don&#39;t have to change it.<br>
We have to keep it.<br>
<br>
-Michael<br>
<br>
&gt;<br>
&gt; Charles<br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt; _______________________________________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br>
_______________________________________________<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></div>