TypeScript/tests/baselines/reference/symbolType18.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

26 lines
446 B
Plaintext

=== tests/cases/conformance/es6/Symbols/symbolType18.ts ===
interface Foo { prop }
>Foo : Foo
>prop : any
var x: symbol | Foo;
>x : symbol | Foo
>Foo : Foo
x;
>x : symbol | Foo
if (typeof x === "object") {
>typeof x === "object" : boolean
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
>x : symbol | Foo
>"object" : "object"
x;
>x : Foo
}
else {
x;
>x : symbol
}