TypeScript/tests/baselines/reference/TypeGuardWithEnumUnion.symbols
2015-04-15 16:44:20 -07:00

89 lines
3.5 KiB
Plaintext

=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
enum Color { R, G, B }
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
>R : Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
>G : Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
>B : Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))
function f1(x: Color | string) {
>f1 : Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
if (typeof x === "number") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
var y = x;
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
var y: Color;
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
}
else {
var z = x;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
var z: string;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
}
}
function f2(x: Color | string | string[]) {
>f2 : Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
if (typeof x === "object") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var y = x;
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var y: string[];
>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
}
if (typeof x === "number") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var z = x;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var z: Color;
>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
}
else {
var w = x;
>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var w: string | string[];
>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
}
if (typeof x === "string") {
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var a = x;
>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var a: string;
>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
}
else {
var b = x;
>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
var b: Color | string[];
>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
}
}