[swift-evolution] [Draft] Change @noreturn to unconstructible return type

Charles Srstka cocoadev at charlessoft.com
Sun Jun 5 17:53:51 CDT 2016


> On Jun 5, 2016, at 5:41 PM, Michael Peternell via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> Am 05.06.2016 um 20:26 schrieb Антон Жилин via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>>:
>> 
>> The following names were suggested: NoReturn, Bottom, None, Never.
>> I would pick None, because it looks like opposite to Any and fits nicely in generic types.
> 
> I would like to call the type `Void`. `Void` is a type with zero possible values. The current `Void` would have to be renamed to `Unit`, the data type with exactly one possible value. Less C, More Haskell :) But wait, that's not really Haskell-ish, and it's not C-ish either.


That is the most confusing possible thing that this could possibly be called. Seeing a Void return will cause anyone coming from a C, C++, ObjC, etc. background to think of something that is definitely *not* a no-return function.

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160605/8e16b66a/attachment.html>


More information about the swift-evolution mailing list