Home > @wixc3/common > UnreachableCaseError
Allows the type checker to detect non-exhaustive switch statements.
Signature:
export declare class UnreachableCaseError extends Error
Extends: Error
declare const align: 'left' | 'right' | 'middle';
switch (align) {
case 'left': return 1;
case 'right': return 2;
// type error since 'middle' is not handled
default: throw new UnreachableCaseError(align);
}
Constructor | Modifiers | Description |
---|---|---|
[(constructor)(switchValue)](/core3-utils/common.unreachablecaseerror._constructor_.html) | Constructs a new instance of the `UnreachableCaseError` class |