I didn't look through all of the replies to this thread to check that this hasn't been mentioned yet, but TypeScript uses the 'never' return type for functions that never return.

https://www.typescriptlang.org/docs/handbook/basic-types.html#never

The type isn't used for any optimisations, it's only used for preventing you from adding lines of code after functions which never return. (Say if they run "forever" or throw exceptions.)

I thought it would be worth mentioning how another language handles this currently.

Reply via email to