Can `Never` be extended to mark parameters, stored properties etc. as not existing?

There's a very intriguing example from @Joe_Groff in regards to typed throws and Never. Basically every function and accessor always has an Error type it throws, but the omission of such basically means that it throws Never.

With that spirit, could we potentially generalized function parameters with variadic packs and the idea from the original post?

// straw man syntax
func f<T..., F, R>(T...) throws F -> R where F: Error

f() // (Never) throws Never -> Void

Each function would always have at least one parameter. The omission of such basically means that its single parameter is Never.

However I hope that this particular extension, isn't too far fetched.


In my mind this also seems to provide a good explanation to what a generic type with variadic generic type parameter could mean when it's empty. It will basically also be Never as a single type parameter.

Borrowing the following example from the variadic packs thread:

Here's why I personally imagine we could eventually achieve:

// today
typealias Void = () // empty tuple as type

// purely hypothetical 
typealias Void = Tuple<>
typealias Void = Tuple<Never> // the pack is not existing as it's `Never`

One of the missing puzzles in the area of variadic packs is the missing ability to add labels to each pack element, within the value pack and the generic type parameter list pack.


All this means that Never would be extended in many more corners of the language, but it seems to me that it would enable lots of ergonomics when writing generic code with it.