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

Brent Royal-Gordon brent at architechies.com
Mon Jun 6 03:22:41 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.


* 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