Skip to content

Commit 1f2338b

Browse files
committed
Update test file and baselines
1 parent 267e598 commit 1f2338b

File tree

4 files changed

+44
-37
lines changed

4 files changed

+44
-37
lines changed

tests/baselines/reference/unknownType2.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (u === 5) {
1313
const y = u.toString(10);
1414
}
1515

16-
if (u === true || u === false) {
16+
if (u === true || u === false) {
1717
const someBool: boolean = u;
1818
}
1919

@@ -25,28 +25,29 @@ if (u === null) {
2525
const someNull: null = u;
2626
}
2727

28-
if(u === symb) {
28+
if (u === symb) {
2929
const symbolAlias: typeof symb = u;
3030
}
3131

3232
if (!(u === 42)) {
33-
u // u should still be `unknown` here
33+
type A = isTrue<isUnknown<typeof u>>
34+
3435
}
3536

3637
if (u !== 42) {
37-
type A = isTrue<isUnknown<typeof u>>
38+
type B = isTrue<isUnknown<typeof u>>
3839
}
3940

4041
if (u == 42) {
41-
type B = isTrue<isUnknown<typeof u>>
42+
type C = isTrue<isUnknown<typeof u>>
4243
}
4344

4445
if (u == true) {
45-
type C = isTrue<isUnknown<typeof u>>
46+
type D = isTrue<isUnknown<typeof u>>
4647
}
4748

4849
if (u == Object) {
49-
type D = isTrue<isUnknown<typeof u>>
50+
type E = isTrue<isUnknown<typeof u>>
5051
}
5152

5253

@@ -70,7 +71,6 @@ if (u === symb) {
7071
var symbolAlias = u;
7172
}
7273
if (!(u === 42)) {
73-
u; // u should still be `unknown` here
7474
}
7575
if (u !== 42) {
7676
}

tests/baselines/reference/unknownType2.symbols

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (u === 5) {
3838
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
3939
}
4040

41-
if (u === true || u === false) {
41+
if (u === true || u === false) {
4242
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
4343
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
4444

@@ -64,7 +64,7 @@ if (u === null) {
6464
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
6565
}
6666

67-
if(u === symb) {
67+
if (u === symb) {
6868
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
6969
>symb : Symbol(symb, Decl(unknownType2.ts, 8, 13))
7070

@@ -77,15 +77,19 @@ if(u === symb) {
7777
if (!(u === 42)) {
7878
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
7979

80-
u // u should still be `unknown` here
80+
type A = isTrue<isUnknown<typeof u>>
81+
>A : Symbol(A, Decl(unknownType2.ts, 30, 18))
82+
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
83+
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
8184
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
85+
8286
}
8387

8488
if (u !== 42) {
8589
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
8690

87-
type A = isTrue<isUnknown<typeof u>>
88-
>A : Symbol(A, Decl(unknownType2.ts, 34, 15))
91+
type B = isTrue<isUnknown<typeof u>>
92+
>B : Symbol(B, Decl(unknownType2.ts, 35, 15))
8993
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
9094
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
9195
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@@ -94,8 +98,8 @@ if (u !== 42) {
9498
if (u == 42) {
9599
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
96100

97-
type B = isTrue<isUnknown<typeof u>>
98-
>B : Symbol(B, Decl(unknownType2.ts, 38, 14))
101+
type C = isTrue<isUnknown<typeof u>>
102+
>C : Symbol(C, Decl(unknownType2.ts, 39, 14))
99103
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
100104
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
101105
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@@ -104,8 +108,8 @@ if (u == 42) {
104108
if (u == true) {
105109
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
106110

107-
type C = isTrue<isUnknown<typeof u>>
108-
>C : Symbol(C, Decl(unknownType2.ts, 42, 16))
111+
type D = isTrue<isUnknown<typeof u>>
112+
>D : Symbol(D, Decl(unknownType2.ts, 43, 16))
109113
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
110114
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
111115
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@@ -115,8 +119,8 @@ if (u == Object) {
115119
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
116120
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
117121

118-
type D = isTrue<isUnknown<typeof u>>
119-
>D : Symbol(D, Decl(unknownType2.ts, 46, 18))
122+
type E = isTrue<isUnknown<typeof u>>
123+
>E : Symbol(E, Decl(unknownType2.ts, 47, 18))
120124
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
121125
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
122126
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

tests/baselines/reference/unknownType2.types

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if (u === 5) {
4949
>10 : 10
5050
}
5151

52-
if (u === true || u === false) {
52+
if (u === true || u === false) {
5353
>u === true || u === false : boolean
5454
>u === true : boolean
5555
>u : unknown
@@ -84,7 +84,7 @@ if (u === null) {
8484
>u : null
8585
}
8686

87-
if(u === symb) {
87+
if (u === symb) {
8888
>u === symb : boolean
8989
>u : unknown
9090
>symb : unique symbol
@@ -102,17 +102,19 @@ if (!(u === 42)) {
102102
>u : unknown
103103
>42 : 42
104104

105-
u // u should still be `unknown` here
105+
type A = isTrue<isUnknown<typeof u>>
106+
>A : true
106107
>u : unknown
108+
107109
}
108110

109111
if (u !== 42) {
110112
>u !== 42 : boolean
111113
>u : unknown
112114
>42 : 42
113115

114-
type A = isTrue<isUnknown<typeof u>>
115-
>A : true
116+
type B = isTrue<isUnknown<typeof u>>
117+
>B : true
116118
>u : unknown
117119
}
118120

@@ -121,8 +123,8 @@ if (u == 42) {
121123
>u : unknown
122124
>42 : 42
123125

124-
type B = isTrue<isUnknown<typeof u>>
125-
>B : true
126+
type C = isTrue<isUnknown<typeof u>>
127+
>C : true
126128
>u : unknown
127129
}
128130

@@ -131,8 +133,8 @@ if (u == true) {
131133
>u : unknown
132134
>true : true
133135

134-
type C = isTrue<isUnknown<typeof u>>
135-
>C : true
136+
type D = isTrue<isUnknown<typeof u>>
137+
>D : true
136138
>u : unknown
137139
}
138140

@@ -141,8 +143,8 @@ if (u == Object) {
141143
>u : unknown
142144
>Object : ObjectConstructor
143145

144-
type D = isTrue<isUnknown<typeof u>>
145-
>D : true
146+
type E = isTrue<isUnknown<typeof u>>
147+
>E : true
146148
>u : unknown
147149
}
148150

tests/cases/conformance/types/unknown/unknownType2.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (u === 5) {
1414
const y = u.toString(10);
1515
}
1616

17-
if (u === true || u === false) {
17+
if (u === true || u === false) {
1818
const someBool: boolean = u;
1919
}
2020

@@ -26,26 +26,27 @@ if (u === null) {
2626
const someNull: null = u;
2727
}
2828

29-
if(u === symb) {
29+
if (u === symb) {
3030
const symbolAlias: typeof symb = u;
3131
}
3232

3333
if (!(u === 42)) {
34-
u // u should still be `unknown` here
34+
type A = isTrue<isUnknown<typeof u>>
35+
3536
}
3637

3738
if (u !== 42) {
38-
type A = isTrue<isUnknown<typeof u>>
39+
type B = isTrue<isUnknown<typeof u>>
3940
}
4041

4142
if (u == 42) {
42-
type B = isTrue<isUnknown<typeof u>>
43+
type C = isTrue<isUnknown<typeof u>>
4344
}
4445

4546
if (u == true) {
46-
type C = isTrue<isUnknown<typeof u>>
47+
type D = isTrue<isUnknown<typeof u>>
4748
}
4849

4950
if (u == Object) {
50-
type D = isTrue<isUnknown<typeof u>>
51+
type E = isTrue<isUnknown<typeof u>>
5152
}

0 commit comments

Comments
 (0)