69e9bfef35
Test that `typeof x === 'random' as string`: 1. Does not issue an error. 2. Does not narrow.
25 lines
403 B
Plaintext
25 lines
403 B
Plaintext
=== tests/cases/conformance/es6/Symbols/symbolType19.ts ===
|
|
enum E { }
|
|
>E : E
|
|
|
|
var x: symbol | E;
|
|
>x : symbol | E
|
|
>E : E
|
|
|
|
x;
|
|
>x : symbol | E
|
|
|
|
if (typeof x === "number") {
|
|
>typeof x === "number" : boolean
|
|
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
|
|
>x : symbol | E
|
|
>"number" : "number"
|
|
|
|
x;
|
|
>x : E
|
|
}
|
|
else {
|
|
x;
|
|
>x : symbol
|
|
}
|