|
| 1 | +=== tests/cases/compiler/ambientConstLiterals.ts === |
| 2 | + |
| 3 | +function f<T>(x: T): T { |
| 4 | +>f : Symbol(f, Decl(ambientConstLiterals.ts, 0, 0)) |
| 5 | +>T : Symbol(T, Decl(ambientConstLiterals.ts, 1, 11)) |
| 6 | +>x : Symbol(x, Decl(ambientConstLiterals.ts, 1, 14)) |
| 7 | +>T : Symbol(T, Decl(ambientConstLiterals.ts, 1, 11)) |
| 8 | +>T : Symbol(T, Decl(ambientConstLiterals.ts, 1, 11)) |
| 9 | + |
| 10 | + return x; |
| 11 | +>x : Symbol(x, Decl(ambientConstLiterals.ts, 1, 14)) |
| 12 | +} |
| 13 | + |
| 14 | +enum E { A, B, C } |
| 15 | +>E : Symbol(E, Decl(ambientConstLiterals.ts, 3, 1)) |
| 16 | +>A : Symbol(E.A, Decl(ambientConstLiterals.ts, 5, 8)) |
| 17 | +>B : Symbol(E.B, Decl(ambientConstLiterals.ts, 5, 11)) |
| 18 | +>C : Symbol(E.C, Decl(ambientConstLiterals.ts, 5, 14)) |
| 19 | + |
| 20 | +const c1 = "abc"; |
| 21 | +>c1 : Symbol(c1, Decl(ambientConstLiterals.ts, 7, 5)) |
| 22 | + |
| 23 | +const c2 = 123; |
| 24 | +>c2 : Symbol(c2, Decl(ambientConstLiterals.ts, 8, 5)) |
| 25 | + |
| 26 | +const c3 = c1; |
| 27 | +>c3 : Symbol(c3, Decl(ambientConstLiterals.ts, 9, 5)) |
| 28 | +>c1 : Symbol(c1, Decl(ambientConstLiterals.ts, 7, 5)) |
| 29 | + |
| 30 | +const c4 = c2; |
| 31 | +>c4 : Symbol(c4, Decl(ambientConstLiterals.ts, 10, 5)) |
| 32 | +>c2 : Symbol(c2, Decl(ambientConstLiterals.ts, 8, 5)) |
| 33 | + |
| 34 | +const c5 = f(123); |
| 35 | +>c5 : Symbol(c5, Decl(ambientConstLiterals.ts, 11, 5)) |
| 36 | +>f : Symbol(f, Decl(ambientConstLiterals.ts, 0, 0)) |
| 37 | + |
| 38 | +const c6 = f(-123); |
| 39 | +>c6 : Symbol(c6, Decl(ambientConstLiterals.ts, 12, 5)) |
| 40 | +>f : Symbol(f, Decl(ambientConstLiterals.ts, 0, 0)) |
| 41 | + |
| 42 | +const c7 = true; |
| 43 | +>c7 : Symbol(c7, Decl(ambientConstLiterals.ts, 13, 5)) |
| 44 | + |
| 45 | +const c8 = E.A; |
| 46 | +>c8 : Symbol(c8, Decl(ambientConstLiterals.ts, 14, 5)) |
| 47 | +>E.A : Symbol(E.A, Decl(ambientConstLiterals.ts, 5, 8)) |
| 48 | +>E : Symbol(E, Decl(ambientConstLiterals.ts, 3, 1)) |
| 49 | +>A : Symbol(E.A, Decl(ambientConstLiterals.ts, 5, 8)) |
| 50 | + |
| 51 | +const c9 = { x: "abc" }; |
| 52 | +>c9 : Symbol(c9, Decl(ambientConstLiterals.ts, 15, 5)) |
| 53 | +>x : Symbol(x, Decl(ambientConstLiterals.ts, 15, 12)) |
| 54 | + |
| 55 | +const c10 = [123]; |
| 56 | +>c10 : Symbol(c10, Decl(ambientConstLiterals.ts, 16, 5)) |
| 57 | + |
| 58 | +const c11 = "abc" + "def"; |
| 59 | +>c11 : Symbol(c11, Decl(ambientConstLiterals.ts, 17, 5)) |
| 60 | + |
| 61 | +const c12 = 123 + 456; |
| 62 | +>c12 : Symbol(c12, Decl(ambientConstLiterals.ts, 18, 5)) |
| 63 | + |
| 64 | +const c13 = Math.random() > 0.5 ? "abc" : "def"; |
| 65 | +>c13 : Symbol(c13, Decl(ambientConstLiterals.ts, 19, 5)) |
| 66 | +>Math.random : Symbol(Math.random, Decl(lib.d.ts, --, --)) |
| 67 | +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 68 | +>random : Symbol(Math.random, Decl(lib.d.ts, --, --)) |
| 69 | + |
| 70 | +const c14 = Math.random() > 0.5 ? 123 : 456; |
| 71 | +>c14 : Symbol(c14, Decl(ambientConstLiterals.ts, 20, 5)) |
| 72 | +>Math.random : Symbol(Math.random, Decl(lib.d.ts, --, --)) |
| 73 | +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 74 | +>random : Symbol(Math.random, Decl(lib.d.ts, --, --)) |
| 75 | + |
0 commit comments