TypeAssertNever
-
Util.TypeAssertNever() - TypeAssertNever(_x: never): never
See
TypeAssertfor details.This is useful for making the compiler enforce fully-covered switch statements.
This function unconditionally throws
InternalLogicError.Example:
switch (x) { case Enum.A: break; case Enum.B: break; default: TypeAssertNever(x); // compiler complains if missing other enum cases }
Parameters
_x: neverReturns: never