never
Never
let foo: never; // Okaylet foo: never = 123; // Error: Type number is not assignable to never
// Okay as the function's return type is `never`
let bar: never = (() => { throw new Error(`Throw my hands in the air like I just don't care`) })();ユースケース: 網羅チェック(Exhaustive Checks)
voidとの混同
voidとの混同最終更新