1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
=== tests/cases/compiler/constEnumErrors.ts ===
const enum E {
>E : Symbol(E, Decl(constEnumErrors.ts, 0, 0))
A
>A : Symbol(E.A, Decl(constEnumErrors.ts, 0, 14))
}
module E {
>E : Symbol(E, Decl(constEnumErrors.ts, 2, 1))
var x = 1;
>x : Symbol(x, Decl(constEnumErrors.ts, 5, 7))
}
const enum E1 {
>E1 : Symbol(E1, Decl(constEnumErrors.ts, 6, 1))
// illegal case
// forward reference to the element of the same enum
X = Y,
>X : Symbol(E1.X, Decl(constEnumErrors.ts, 8, 15))
>Y : Symbol(E1.Y, Decl(constEnumErrors.ts, 11, 10))
// forward reference to the element of the same enum
Y = E1.Z,
>Y : Symbol(E1.Y, Decl(constEnumErrors.ts, 11, 10))
>E1 : Symbol(E1, Decl(constEnumErrors.ts, 6, 1))
Y1 = E1["Z"]
>Y1 : Symbol(E1.Y1, Decl(constEnumErrors.ts, 13, 13))
>E1 : Symbol(E1, Decl(constEnumErrors.ts, 6, 1))
}
const enum E2 {
>E2 : Symbol(E2, Decl(constEnumErrors.ts, 15, 1))
A
>A : Symbol(E2.A, Decl(constEnumErrors.ts, 17, 15))
}
var y0 = E2[1]
>y0 : Symbol(y0, Decl(constEnumErrors.ts, 21, 3))
>E2 : Symbol(E2, Decl(constEnumErrors.ts, 15, 1))
var name = "A";
>name : Symbol(name, Decl(constEnumErrors.ts, 22, 3))
var y1 = E2[name];
>y1 : Symbol(y1, Decl(constEnumErrors.ts, 23, 3))
>E2 : Symbol(E2, Decl(constEnumErrors.ts, 15, 1))
>name : Symbol(name, Decl(constEnumErrors.ts, 22, 3))
var x = E2;
>x : Symbol(x, Decl(constEnumErrors.ts, 25, 3))
>E2 : Symbol(E2, Decl(constEnumErrors.ts, 15, 1))
var y = [E2];
>y : Symbol(y, Decl(constEnumErrors.ts, 26, 3))
>E2 : Symbol(E2, Decl(constEnumErrors.ts, 15, 1))
function foo(t: any): void {
>foo : Symbol(foo, Decl(constEnumErrors.ts, 26, 13))
>t : Symbol(t, Decl(constEnumErrors.ts, 28, 13))
}
foo(E2);
>foo : Symbol(foo, Decl(constEnumErrors.ts, 26, 13))
>E2 : Symbol(E2, Decl(constEnumErrors.ts, 15, 1))
const enum NaNOrInfinity {
>NaNOrInfinity : Symbol(NaNOrInfinity, Decl(constEnumErrors.ts, 31, 8))
A = 9007199254740992,
>A : Symbol(NaNOrInfinity.A, Decl(constEnumErrors.ts, 33, 26))
B = A * A,
>B : Symbol(NaNOrInfinity.B, Decl(constEnumErrors.ts, 34, 25))
>A : Symbol(NaNOrInfinity.A, Decl(constEnumErrors.ts, 33, 26))
>A : Symbol(NaNOrInfinity.A, Decl(constEnumErrors.ts, 33, 26))
C = B * B,
>C : Symbol(NaNOrInfinity.C, Decl(constEnumErrors.ts, 35, 14))
>B : Symbol(NaNOrInfinity.B, Decl(constEnumErrors.ts, 34, 25))
>B : Symbol(NaNOrInfinity.B, Decl(constEnumErrors.ts, 34, 25))
D = C * C,
>D : Symbol(NaNOrInfinity.D, Decl(constEnumErrors.ts, 36, 14))
>C : Symbol(NaNOrInfinity.C, Decl(constEnumErrors.ts, 35, 14))
>C : Symbol(NaNOrInfinity.C, Decl(constEnumErrors.ts, 35, 14))
E = D * D,
>E : Symbol(NaNOrInfinity.E, Decl(constEnumErrors.ts, 37, 14))
>D : Symbol(NaNOrInfinity.D, Decl(constEnumErrors.ts, 36, 14))
>D : Symbol(NaNOrInfinity.D, Decl(constEnumErrors.ts, 36, 14))
F = E * E, // overflow
>F : Symbol(NaNOrInfinity.F, Decl(constEnumErrors.ts, 38, 14))
>E : Symbol(NaNOrInfinity.E, Decl(constEnumErrors.ts, 37, 14))
>E : Symbol(NaNOrInfinity.E, Decl(constEnumErrors.ts, 37, 14))
G = 1 / 0, // overflow
>G : Symbol(NaNOrInfinity.G, Decl(constEnumErrors.ts, 39, 14))
H = 0 / 0 // NaN
>H : Symbol(NaNOrInfinity.H, Decl(constEnumErrors.ts, 40, 14))
}
|