[swift-evolution] [Draft] Change @noreturn to unconstructible return type
L. Mihalkovic
laurent.mihalkovic at gmail.com
Mon Jun 6 04:08:11 CDT 2016
>> This is a language that has put protocol centerstage. It stands to reason express something as essential using a protocol.
>>
>> protocol Nothing {}
>>
>> seems more than rational
>
> No, this doesn't make sense as a protocol. You should not be able to conform to Nothing, but you could conform to this protocol. You *should* be able to cast anything to Nothing, which this definition doesn't allow. You should be able to call any method, property, or subscript on Nothing* (none of them will actually work), but Nothing has no methods. A `protocol Nothing` is, frankly, the exact *opposite* of what Nothing should be.
Interesting viewpoint. My only issue with it is that it tends to perpetuate the magic that exists between compiler and stdlib: there are many areas where they seem to be gratuitiously joined at the hip by shared secret hanshakes.
>
>
> * At least notionally. It wouldn't be wrong to omit that as clever, but pointless.
>
> --
> Brent Royal-Gordon
> Architechies
>
More information about the swift-evolution
mailing list