3 ms·
The never type seems very useful in various languages to either signal that a branch can never happen (the example of string -> bytestring never erroring) or to
by epolanski 21d ago
The never type seems very useful in various languages to either signal that a branch can never happen (the example of string -> bytestring never erroring) or to mark that a function will never return a value (and thus control) to the caller.
A simple TypeScript example:
const forever = (): never => {
while (true) {
// whatever
}
}