TypeScript/tests/baselines/reference/symbolType19.types
Nathan Shively-Sanders 69e9bfef35 Add typeof test case and update baselines
Test that `typeof x === 'random' as string`:

1. Does not issue an error.
2. Does not narrow.
2017-01-31 10:28:32 -08:00

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
}