58 lines
732 B
Text
58 lines
732 B
Text
=== tests/cases/conformance/types/never/neverTypeErrors2.ts ===
|
|
function f1() {
|
|
>f1 : () => void
|
|
|
|
let x: never;
|
|
>x : never
|
|
|
|
x = 1;
|
|
>x = 1 : 1
|
|
>x : never
|
|
>1 : 1
|
|
|
|
x = "abc";
|
|
>x = "abc" : "abc"
|
|
>x : never
|
|
>"abc" : "abc"
|
|
|
|
x = false;
|
|
>x = false : false
|
|
>x : never
|
|
>false : false
|
|
|
|
x = undefined;
|
|
>x = undefined : undefined
|
|
>x : never
|
|
>undefined : undefined
|
|
|
|
x = null;
|
|
>x = null : null
|
|
>x : never
|
|
>null : null
|
|
|
|
x = {};
|
|
>x = {} : {}
|
|
>x : never
|
|
>{} : {}
|
|
|
|
x();
|
|
>x() : any
|
|
>x : never
|
|
}
|
|
|
|
function f2(): never {
|
|
>f2 : () => never
|
|
|
|
return;
|
|
}
|
|
|
|
function f3(): never {
|
|
>f3 : () => never
|
|
|
|
return 1;
|
|
>1 : 1
|
|
}
|
|
|
|
function f4(): never {
|
|
>f4 : () => never
|
|
}
|