26 lines
340 B
TypeScript
26 lines
340 B
TypeScript
// @strictNullChecks: true
|
|
|
|
function f1() {
|
|
let x: never;
|
|
x = 1;
|
|
x = "abc";
|
|
x = false;
|
|
x = undefined;
|
|
x = null;
|
|
x = {};
|
|
x();
|
|
}
|
|
|
|
function f2(): never {
|
|
return;
|
|
}
|
|
|
|
function f3(): never {
|
|
return 1;
|
|
}
|
|
|
|
function f4(): never {
|
|
}
|
|
|
|
for (const n of f4()) {}
|
|
for (const n in f4()) {}
|