by ngruhn · 1mo ago · 0 comments
function exhaustive(witness: never): never {
return witness
}
https://www.typescriptlang.org/play/?#code/FAFwngDgpgBAKgZQB... default:
matched satisfies never
throw new Error(...)
You don't even need a function.[0]: https://docs.python.org/3/library/typing.html#typing.assert_...