Skip to content

Commit 1f5d7a3

Browse files
committed
Accept new baselines
1 parent 9aec49b commit 1f5d7a3

5 files changed

+28
-35
lines changed

tests/baselines/reference/genericUnboundedTypeParamAssignability.errors.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
genericUnboundedTypeParamAssignability.ts(2,5): error TS2339: Property 'toString' does not exist on type 'T'.
1+
genericUnboundedTypeParamAssignability.ts(2,3): error TS18049: 'o' is possibly 'null' or 'undefined'.
22
genericUnboundedTypeParamAssignability.ts(15,6): error TS2345: Argument of type 'T' is not assignable to parameter of type '{}'.
33
genericUnboundedTypeParamAssignability.ts(16,6): error TS2345: Argument of type 'T' is not assignable to parameter of type 'Record<string, any>'.
4-
genericUnboundedTypeParamAssignability.ts(17,5): error TS2339: Property 'toString' does not exist on type 'T'.
4+
genericUnboundedTypeParamAssignability.ts(17,3): error TS18049: 't' is possibly 'null' or 'undefined'.
55

66

77
==== genericUnboundedTypeParamAssignability.ts (4 errors) ====
88
function f1<T>(o: T) {
99
o.toString(); // error
10-
~~~~~~~~
11-
!!! error TS2339: Property 'toString' does not exist on type 'T'.
10+
~
11+
!!! error TS18049: 'o' is possibly 'null' or 'undefined'.
1212
}
1313

1414
function f2<T extends {}>(o: T) {
@@ -30,7 +30,7 @@ genericUnboundedTypeParamAssignability.ts(17,5): error TS2339: Property 'toStrin
3030
!!! error TS2345: Argument of type 'T' is not assignable to parameter of type 'Record<string, any>'.
3131
!!! related TS2208 genericUnboundedTypeParamAssignability.ts:13:15: This type parameter might need an `extends Record<string, any>` constraint.
3232
t.toString(); // error, for the same reason as f1()
33-
~~~~~~~~
34-
!!! error TS2339: Property 'toString' does not exist on type 'T'.
33+
~
34+
!!! error TS18049: 't' is possibly 'null' or 'undefined'.
3535
}
3636

tests/baselines/reference/genericUnboundedTypeParamAssignability.symbols

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ function f1<T>(o: T) {
88
>T : Symbol(T, Decl(genericUnboundedTypeParamAssignability.ts, 0, 12))
99

1010
o.toString(); // error
11+
>o.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
1112
>o : Symbol(o, Decl(genericUnboundedTypeParamAssignability.ts, 0, 15))
13+
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
1214
}
1315

1416
function f2<T extends {}>(o: T) {
@@ -55,6 +57,8 @@ function user<T>(t: T) {
5557
>t : Symbol(t, Decl(genericUnboundedTypeParamAssignability.ts, 12, 17))
5658

5759
t.toString(); // error, for the same reason as f1()
60+
>t.toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
5861
>t : Symbol(t, Decl(genericUnboundedTypeParamAssignability.ts, 12, 17))
62+
>toString : Symbol(Object.toString, Decl(lib.es5.d.ts, --, --))
5963
}
6064

tests/baselines/reference/genericUnboundedTypeParamAssignability.types

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ function f1<T>(o: T) {
88
> : ^
99

1010
o.toString(); // error
11-
>o.toString() : any
12-
> : ^^^
13-
>o.toString : any
14-
> : ^^^
11+
>o.toString() : string
12+
> : ^^^^^^
13+
>o.toString : () => string
14+
> : ^^^^^^
1515
>o : T
1616
> : ^
17-
>toString : any
18-
> : ^^^
17+
>toString : () => string
18+
> : ^^^^^^
1919
}
2020

2121
function f2<T extends {}>(o: T) {
@@ -83,13 +83,13 @@ function user<T>(t: T) {
8383
> : ^
8484

8585
t.toString(); // error, for the same reason as f1()
86-
>t.toString() : any
87-
> : ^^^
88-
>t.toString : any
89-
> : ^^^
86+
>t.toString() : string
87+
> : ^^^^^^
88+
>t.toString : () => string
89+
> : ^^^^^^
9090
>t : T
9191
> : ^
92-
>toString : any
93-
> : ^^^
92+
>toString : () => string
93+
> : ^^^^^^
9494
}
9595

tests/baselines/reference/inKeywordTypeguard(strict=true).errors.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ inKeywordTypeguard.ts(90,5): error TS2564: Property 'a' has no initializer and i
3030
inKeywordTypeguard.ts(94,26): error TS2339: Property 'a' does not exist on type 'never'.
3131
inKeywordTypeguard.ts(155,16): error TS18046: 'x' is of type 'unknown'.
3232
inKeywordTypeguard.ts(158,21): error TS2638: Type '{}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator.
33-
inKeywordTypeguard.ts(183,16): error TS2322: Type 'T' is not assignable to type 'object'.
33+
inKeywordTypeguard.ts(183,16): error TS18049: 'x' is possibly 'null' or 'undefined'.
3434
inKeywordTypeguard.ts(186,21): error TS2638: Type 'NonNullable<T>' may represent a primitive value, which is not permitted as the right operand of the 'in' operator.
3535

3636

@@ -277,8 +277,7 @@ inKeywordTypeguard.ts(186,21): error TS2638: Type 'NonNullable<T>' may represent
277277
function f3<T>(x: T) {
278278
if ("a" in x) {
279279
~
280-
!!! error TS2322: Type 'T' is not assignable to type 'object'.
281-
!!! related TS2208 inKeywordTypeguard.ts:182:13: This type parameter might need an `extends object` constraint.
280+
!!! error TS18049: 'x' is possibly 'null' or 'undefined'.
282281
x.a;
283282
}
284283
if (x && "a" in x) {

tests/baselines/reference/keyofAndIndexedAccess.errors.txt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
keyofAndIndexedAccess.ts(205,24): error TS2322: Type 'T[keyof T]' is not assignable to type 'object'.
2-
Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'object'.
3-
Type 'T[string]' is not assignable to type 'object'.
4-
keyofAndIndexedAccess.ts(211,24): error TS2322: Type 'T[K]' is not assignable to type 'object'.
5-
Type 'T[keyof T]' is not assignable to type 'object'.
6-
Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'object'.
7-
Type 'T[string]' is not assignable to type 'object'.
1+
keyofAndIndexedAccess.ts(205,24): error TS2533: Object is possibly 'null' or 'undefined'.
2+
keyofAndIndexedAccess.ts(211,24): error TS2533: Object is possibly 'null' or 'undefined'.
83
keyofAndIndexedAccess.ts(316,5): error TS2322: Type 'T' is not assignable to type '{}'.
94
keyofAndIndexedAccess.ts(317,5): error TS2322: Type 'T[keyof T]' is not assignable to type '{}'.
105
Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{}'.
@@ -222,20 +217,15 @@ keyofAndIndexedAccess.ts(318,5): error TS2322: Type 'T[K]' is not assignable to
222217
}
223218
const b = "foo" in obj[key];
224219
~~~~~~~~
225-
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'object'.
226-
!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'object'.
227-
!!! error TS2322: Type 'T[string]' is not assignable to type 'object'.
220+
!!! error TS2533: Object is possibly 'null' or 'undefined'.
228221
}
229222

230223
function f55<T, K extends keyof T>(obj: T, key: K) {
231224
for (let s in obj[key]) {
232225
}
233226
const b = "foo" in obj[key];
234227
~~~~~~~~
235-
!!! error TS2322: Type 'T[K]' is not assignable to type 'object'.
236-
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'object'.
237-
!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type 'object'.
238-
!!! error TS2322: Type 'T[string]' is not assignable to type 'object'.
228+
!!! error TS2533: Object is possibly 'null' or 'undefined'.
239229
}
240230

241231
function f60<T>(source: T, target: T) {

0 commit comments

Comments
 (0)