Skip to content

Commit 21d8e9a

Browse files
committed
Update old test
1 parent 3a96b24 commit 21d8e9a

File tree

5 files changed

+71
-151
lines changed

5 files changed

+71
-151
lines changed

tests/baselines/reference/enumBasics.errors.txt

Lines changed: 0 additions & 86 deletions
This file was deleted.

tests/baselines/reference/enumBasics.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ var x: number = E1.A;
1212
// Enum object type is anonymous with properties of the enum type and numeric indexer
1313
var e = E1;
1414
var e: {
15-
readonly A: E1;
16-
readonly B: E1;
17-
readonly C: E1;
15+
readonly A: E1.A;
16+
readonly B: E1.B;
17+
readonly C: E1.C;
1818
readonly [n: number]: string;
1919
};
2020
var e: typeof E1;

tests/baselines/reference/enumBasics.symbols

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@ var e = E1;
2828
var e: {
2929
>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3))
3030

31-
readonly A: E1;
31+
readonly A: E1.A;
3232
>A : Symbol(A, Decl(enumBasics.ts, 12, 8))
3333
>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0))
34+
>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9))
3435

35-
readonly B: E1;
36-
>B : Symbol(B, Decl(enumBasics.ts, 13, 19))
36+
readonly B: E1.B;
37+
>B : Symbol(B, Decl(enumBasics.ts, 13, 21))
3738
>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0))
39+
>B : Symbol(E1.B, Decl(enumBasics.ts, 2, 6))
3840

39-
readonly C: E1;
40-
>C : Symbol(C, Decl(enumBasics.ts, 14, 19))
41+
readonly C: E1.C;
42+
>C : Symbol(C, Decl(enumBasics.ts, 14, 21))
4143
>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0))
44+
>C : Symbol(E1.C, Decl(enumBasics.ts, 3, 6))
4245

4346
readonly [n: number]: string;
4447
>n : Symbol(n, Decl(enumBasics.ts, 16, 14))

tests/baselines/reference/enumBasics.types

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ enum E1 {
44
>E1 : E1
55

66
A,
7-
>A : E1
7+
>A : E1.A
88

99
B,
10-
>B : E1
10+
>B : E1.B
1111

1212
C
13-
>C : E1
13+
>C : E1.C
1414
}
1515

1616
// Enum type is a subtype of Number
1717
var x: number = E1.A;
1818
>x : number
19-
>E1.A : E1
19+
>E1.A : E1.A
2020
>E1 : typeof E1
21-
>A : E1
21+
>A : E1.A
2222

2323
// Enum object type is anonymous with properties of the enum type and numeric indexer
2424
var e = E1;
@@ -28,17 +28,20 @@ var e = E1;
2828
var e: {
2929
>e : typeof E1
3030

31-
readonly A: E1;
32-
>A : E1
33-
>E1 : E1
31+
readonly A: E1.A;
32+
>A : E1.A
33+
>E1 : any
34+
>A : E1.A
3435

35-
readonly B: E1;
36-
>B : E1
37-
>E1 : E1
36+
readonly B: E1.B;
37+
>B : E1.B
38+
>E1 : any
39+
>B : E1.B
3840

39-
readonly C: E1;
40-
>C : E1
41-
>E1 : E1
41+
readonly C: E1.C;
42+
>C : E1.C
43+
>E1 : any
44+
>C : E1.C
4245

4346
readonly [n: number]: string;
4447
>n : number
@@ -53,9 +56,9 @@ var s = E1[e.A];
5356
>s : string
5457
>E1[e.A] : string
5558
>E1 : typeof E1
56-
>e.A : E1
59+
>e.A : E1.A
5760
>e : typeof E1
58-
>A : E1
61+
>A : E1.A
5962

6063
var s: string;
6164
>s : string
@@ -66,12 +69,12 @@ enum E2 {
6669
>E2 : E2
6770

6871
A = 1, B = 2, C = 3
69-
>A : E2
70-
>1 : number
71-
>B : E2
72-
>2 : number
73-
>C : E2
74-
>3 : number
72+
>A : E2.A
73+
>1 : 1
74+
>B : E2.B
75+
>2 : 2
76+
>C : E2.C
77+
>3 : 3
7578
}
7679

7780
// Enum with only computed members
@@ -81,15 +84,15 @@ enum E3 {
8184
X = 'foo'.length, Y = 4 + 3, Z = +'foo'
8285
>X : E3
8386
>'foo'.length : number
84-
>'foo' : string
87+
>'foo' : "foo"
8588
>length : number
8689
>Y : E3
8790
>4 + 3 : number
88-
>4 : number
89-
>3 : number
91+
>4 : 4
92+
>3 : 3
9093
>Z : E3
9194
>+'foo' : number
92-
>'foo' : string
95+
>'foo' : "foo"
9396
}
9497

9598
// Enum with constant members followed by computed members
@@ -98,11 +101,11 @@ enum E4 {
98101

99102
X = 0, Y, Z = 'foo'.length
100103
>X : E4
101-
>0 : number
104+
>0 : 0
102105
>Y : E4
103106
>Z : E4
104107
>'foo'.length : number
105-
>'foo' : string
108+
>'foo' : "foo"
106109
>length : number
107110
}
108111

@@ -111,28 +114,28 @@ enum E5 {
111114
>E5 : E5
112115

113116
A,
114-
>A : E5
117+
>A : E5.A
115118

116119
B = 3,
117-
>B : E5
118-
>3 : number
120+
>B : E5.B
121+
>3 : 3
119122

120123
C // 4
121-
>C : E5
124+
>C : E5.C
122125
}
123126

124127
enum E6 {
125128
>E6 : E6
126129

127130
A,
128-
>A : E6
131+
>A : E6.A
129132

130133
B = 0,
131-
>B : E6
132-
>0 : number
134+
>B : E6.A
135+
>0 : 0
133136

134137
C // 1
135-
>C : E6
138+
>C : E6.C
136139
}
137140

138141
// Enum with computed member initializer of type 'any'
@@ -142,8 +145,8 @@ enum E7 {
142145
A = 'foo'['foo']
143146
>A : E7
144147
>'foo'['foo'] : any
145-
>'foo' : string
146-
>'foo' : string
148+
>'foo' : "foo"
149+
>'foo' : "foo"
147150
}
148151

149152
// Enum with computed member initializer of type number
@@ -153,8 +156,8 @@ enum E8 {
153156
B = 'foo'['foo']
154157
>B : E8
155158
>'foo'['foo'] : any
156-
>'foo' : string
157-
>'foo' : string
159+
>'foo' : "foo"
160+
>'foo' : "foo"
158161
}
159162

160163
//Enum with computed member intializer of same enum type
@@ -198,8 +201,8 @@ var doNotPropagate = [
198201
];
199202
// Enum computed members are not propagated
200203
var doPropagate = [
201-
>doPropagate : (E5 | E6 | E9)[]
202-
>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E5 | E6 | E9)[]
204+
>doPropagate : (E9 | E6 | E5)[]
205+
>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E9 | E6 | E5)[]
203206

204207
E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C
205208
>E9.A : E9
@@ -208,24 +211,24 @@ var doPropagate = [
208211
>E9.B : E9
209212
>E9 : typeof E9
210213
>B : E9
211-
>E6.B : E6
214+
>E6.B : E6.A
212215
>E6 : typeof E6
213-
>B : E6
214-
>E6.C : E6
216+
>B : E6.A
217+
>E6.C : E6.C
215218
>E6 : typeof E6
216-
>C : E6
217-
>E6.A : E6
219+
>C : E6.C
220+
>E6.A : E6.A
218221
>E6 : typeof E6
219-
>A : E6
220-
>E5.A : E5
222+
>A : E6.A
223+
>E5.A : E5.A
221224
>E5 : typeof E5
222-
>A : E5
223-
>E5.B : E5
225+
>A : E5.A
226+
>E5.B : E5.B
224227
>E5 : typeof E5
225-
>B : E5
226-
>E5.C : E5
228+
>B : E5.B
229+
>E5.C : E5.C
227230
>E5 : typeof E5
228-
>C : E5
231+
>C : E5.C
229232

230233
];
231234

tests/cases/conformance/enums/enumBasics.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ var x: number = E1.A;
1111
// Enum object type is anonymous with properties of the enum type and numeric indexer
1212
var e = E1;
1313
var e: {
14-
readonly A: E1;
15-
readonly B: E1;
16-
readonly C: E1;
14+
readonly A: E1.A;
15+
readonly B: E1.B;
16+
readonly C: E1.C;
1717
readonly [n: number]: string;
1818
};
1919
var e: typeof E1;

0 commit comments

Comments
 (0)