|
| 1 | +=== tests/cases/compiler/objectLiteralEnumPropertyNames.ts === |
| 2 | +// Fixes #16887 |
| 3 | +enum Strs { |
| 4 | +>Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) |
| 5 | + |
| 6 | + A = 'a', |
| 7 | +>A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) |
| 8 | + |
| 9 | + B = 'b' |
| 10 | +>B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) |
| 11 | +} |
| 12 | +type TestStrs = { [key in Strs]: string } |
| 13 | +>TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) |
| 14 | +>key : Symbol(key, Decl(objectLiteralEnumPropertyNames.ts, 5, 19)) |
| 15 | +>Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) |
| 16 | + |
| 17 | +const x: TestStrs = { |
| 18 | +>x : Symbol(x, Decl(objectLiteralEnumPropertyNames.ts, 6, 5)) |
| 19 | +>TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) |
| 20 | + |
| 21 | + [Strs.A]: 'xo', |
| 22 | +>Strs.A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) |
| 23 | +>Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) |
| 24 | +>A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) |
| 25 | + |
| 26 | + [Strs.B]: 'xe' |
| 27 | +>Strs.B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) |
| 28 | +>Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) |
| 29 | +>B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) |
| 30 | +} |
| 31 | +const ux = { |
| 32 | +>ux : Symbol(ux, Decl(objectLiteralEnumPropertyNames.ts, 10, 5)) |
| 33 | + |
| 34 | + [Strs.A]: 'xo', |
| 35 | +>Strs.A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) |
| 36 | +>Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) |
| 37 | +>A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) |
| 38 | + |
| 39 | + [Strs.B]: 'xe' |
| 40 | +>Strs.B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) |
| 41 | +>Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) |
| 42 | +>B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) |
| 43 | +} |
| 44 | +const y: TestStrs = { |
| 45 | +>y : Symbol(y, Decl(objectLiteralEnumPropertyNames.ts, 14, 5)) |
| 46 | +>TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) |
| 47 | + |
| 48 | + ['a']: 'yo', |
| 49 | +>'a' : Symbol(['a'], Decl(objectLiteralEnumPropertyNames.ts, 14, 21)) |
| 50 | + |
| 51 | + ['b']: 'ye' |
| 52 | +>'b' : Symbol(['b'], Decl(objectLiteralEnumPropertyNames.ts, 15, 16)) |
| 53 | +} |
| 54 | +const a = 'a'; |
| 55 | +>a : Symbol(a, Decl(objectLiteralEnumPropertyNames.ts, 18, 5)) |
| 56 | + |
| 57 | +const b = 'b'; |
| 58 | +>b : Symbol(b, Decl(objectLiteralEnumPropertyNames.ts, 19, 5)) |
| 59 | + |
| 60 | +const z: TestStrs = { |
| 61 | +>z : Symbol(z, Decl(objectLiteralEnumPropertyNames.ts, 20, 5)) |
| 62 | +>TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) |
| 63 | + |
| 64 | + [a]: 'zo', |
| 65 | +>a : Symbol(a, Decl(objectLiteralEnumPropertyNames.ts, 18, 5)) |
| 66 | + |
| 67 | + [b]: 'ze' |
| 68 | +>b : Symbol(b, Decl(objectLiteralEnumPropertyNames.ts, 19, 5)) |
| 69 | +} |
| 70 | +const uz = { |
| 71 | +>uz : Symbol(uz, Decl(objectLiteralEnumPropertyNames.ts, 24, 5)) |
| 72 | + |
| 73 | + [a]: 'zo', |
| 74 | +>a : Symbol(a, Decl(objectLiteralEnumPropertyNames.ts, 18, 5)) |
| 75 | + |
| 76 | + [b]: 'ze' |
| 77 | +>b : Symbol(b, Decl(objectLiteralEnumPropertyNames.ts, 19, 5)) |
| 78 | +} |
| 79 | + |
| 80 | +enum Nums { |
| 81 | +>Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) |
| 82 | + |
| 83 | + A, |
| 84 | +>A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) |
| 85 | + |
| 86 | + B |
| 87 | +>B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) |
| 88 | +} |
| 89 | +type TestNums = { 0: number, 1: number } |
| 90 | +>TestNums : Symbol(TestNums, Decl(objectLiteralEnumPropertyNames.ts, 32, 1)) |
| 91 | + |
| 92 | +const n: TestNums = { |
| 93 | +>n : Symbol(n, Decl(objectLiteralEnumPropertyNames.ts, 34, 5)) |
| 94 | +>TestNums : Symbol(TestNums, Decl(objectLiteralEnumPropertyNames.ts, 32, 1)) |
| 95 | + |
| 96 | + [Nums.A]: 1, |
| 97 | +>Nums.A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) |
| 98 | +>Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) |
| 99 | +>A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) |
| 100 | + |
| 101 | + [Nums.B]: 2 |
| 102 | +>Nums.B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) |
| 103 | +>Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) |
| 104 | +>B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) |
| 105 | +} |
| 106 | +const un = { |
| 107 | +>un : Symbol(un, Decl(objectLiteralEnumPropertyNames.ts, 38, 5)) |
| 108 | + |
| 109 | + [Nums.A]: 3, |
| 110 | +>Nums.A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) |
| 111 | +>Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) |
| 112 | +>A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) |
| 113 | + |
| 114 | + [Nums.B]: 4 |
| 115 | +>Nums.B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) |
| 116 | +>Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) |
| 117 | +>B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) |
| 118 | +} |
| 119 | +const an = 0; |
| 120 | +>an : Symbol(an, Decl(objectLiteralEnumPropertyNames.ts, 42, 5)) |
| 121 | + |
| 122 | +const bn = 1; |
| 123 | +>bn : Symbol(bn, Decl(objectLiteralEnumPropertyNames.ts, 43, 5)) |
| 124 | + |
| 125 | +const m: TestNums = { |
| 126 | +>m : Symbol(m, Decl(objectLiteralEnumPropertyNames.ts, 44, 5)) |
| 127 | +>TestNums : Symbol(TestNums, Decl(objectLiteralEnumPropertyNames.ts, 32, 1)) |
| 128 | + |
| 129 | + [an]: 5, |
| 130 | +>an : Symbol(an, Decl(objectLiteralEnumPropertyNames.ts, 42, 5)) |
| 131 | + |
| 132 | + [bn]: 6 |
| 133 | +>bn : Symbol(bn, Decl(objectLiteralEnumPropertyNames.ts, 43, 5)) |
| 134 | +} |
| 135 | +const um = { |
| 136 | +>um : Symbol(um, Decl(objectLiteralEnumPropertyNames.ts, 48, 5)) |
| 137 | + |
| 138 | + [an]: 7, |
| 139 | +>an : Symbol(an, Decl(objectLiteralEnumPropertyNames.ts, 42, 5)) |
| 140 | + |
| 141 | + [bn]: 8 |
| 142 | +>bn : Symbol(bn, Decl(objectLiteralEnumPropertyNames.ts, 43, 5)) |
| 143 | +} |
| 144 | + |
0 commit comments