unreachable
Marks a code path as logically impossible and throws if execution reaches it.
Usage
unreachable(message?)
Use unreachable as a runtime assertion for invariants the type system cannot express. Its never return type allows it in any expression position. Reaching the call indicates a bug in the program or invalid data crossing a boundary.
Parameters
messagestringoptional
optional context appended to the thrown error message.
Returns
never returns; the function always throws.
Throws
An Error with entered unreachable code, optionally followed by message.
See also
todo— unfinished behaviorunimplemented— intentionally unsupported behavior