I just realized you can add init() methods to `Never` in an extension.

As long as you fatalError() in there, the compiler is totally fine with it.

This is very very interesting to me.

@davedelong this feels very much in line with how little Never has to special-case. It just happens to be a type with no values, not a special kind of type.

@cocoaphony I stumbled upon this as I was thinking about the assertion and failure api I've developed. I currently do Abort.because("reason"), but I realized I could do Never(because: "reason") as well.

I'm thinking about how much I like this or not

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!