gleam
gleam copied to clipboard
Add Never type to Prelude (WIP on warning for expressions after a function with return type Never)
As discussed in #3044 it would be neat to add a type to the Prelude which could represent functions which never return.
The Never
type can not be constructed because if it could be constructed then someone could write a function which does return at some point with it.
For example we don't want this to be possible:
fn go_forever() -> Never {
// oh no it actually does stop!
Never
}
WIP on figuring out where to add in the Warning for expressions coming after a function/expression of type Never
.
I see... then I guess I will just mark this as a draft for now and wait until a final design has been decided on. (This PR can also just be closed if it is taking up space)
Closing due to inactivity. Please feel free to reopen! Thank you