Skip to content

Instantly share code, notes, and snippets.

@fsubal
Last active January 14, 2025 11:35
Show Gist options
  • Save fsubal/e7e8cd052ccfda889df3c098232697ca to your computer and use it in GitHub Desktop.
Save fsubal/e7e8cd052ccfda889df3c098232697ca to your computer and use it in GitHub Desktop.
export class Unreachable extends TypeError {
static assert(value: never): never {
throw new this(value)
}
static silent(value: never): void {
void value
}
constructor(value: never) {
super(`Unreachable: ${value}`)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment