TypeScript/tests/cases/conformance/types/never/neverTypeErrors1.ts
Andy a9aca81601
Error on for (const x in never) (#22988)
* Error on `for (const x in never)`

* Update diagnostic

* Provide argument to diagnostic
2018-03-29 11:39:30 -07:00

25 lines
310 B
TypeScript

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()) {}