3 ms·
You can actually have it built-in (via default case in 'switch' statements having a 'never()' statement). But it's less powerful than Rust's.
by cyberax 9mo ago
You can actually have it built-in (via default case in 'switch' statements having a 'never()' statement). But it's less powerful than Rust's.
- nikeee 9mo agoOr you don't use the defualt case and rely on definite assignment analysis or checks for returns in every code path. I find the never type in TS actually being a proper bottom type + having control-flow based types vastly superior to what rust offers.