Skip to content

Commit 92c17ce

Browse files
committed
Accept new baselines
1 parent 46de506 commit 92c17ce

4 files changed

+18
-11
lines changed

tests/baselines/reference/mappedTypes4.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function boxify<T>(obj: T): Boxified<T> {
4545
}
4646
return <any>obj;
4747
><any>obj : any
48-
>obj : never
48+
>obj : T
4949
}
5050

5151
type A = { a: string };

tests/baselines/reference/recursiveTypeRelations.errors.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
tests/cases/compiler/recursiveTypeRelations.ts(8,5): error TS2391: Function implementation is missing or not immediately following the declaration.
22
tests/cases/compiler/recursiveTypeRelations.ts(27,38): error TS2304: Cannot find name 'ClassNameObject'.
3+
tests/cases/compiler/recursiveTypeRelations.ts(27,55): error TS2345: Argument of type '(obj: any, key: keyof S) => any' is not assignable to parameter of type '(previousValue: any, currentValue: string, currentIndex: number, array: string[]) => any'.
4+
Types of parameters 'key' and 'currentValue' are incompatible.
5+
Type 'string' is not assignable to type 'keyof S'.
36
tests/cases/compiler/recursiveTypeRelations.ts(27,61): error TS2304: Cannot find name 'ClassNameObject'.
47

58

6-
==== tests/cases/compiler/recursiveTypeRelations.ts (3 errors) ====
9+
==== tests/cases/compiler/recursiveTypeRelations.ts (4 errors) ====
710
// Repro from #14896
811

912
type Attributes<Keys extends keyof any> = {
@@ -35,6 +38,10 @@ tests/cases/compiler/recursiveTypeRelations.ts(27,61): error TS2304: Cannot find
3538
return Object.keys(arg).reduce<ClassNameObject>((obj: ClassNameObject, key: keyof S) => {
3639
~~~~~~~~~~~~~~~
3740
!!! error TS2304: Cannot find name 'ClassNameObject'.
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42+
!!! error TS2345: Argument of type '(obj: any, key: keyof S) => any' is not assignable to parameter of type '(previousValue: any, currentValue: string, currentIndex: number, array: string[]) => any'.
43+
!!! error TS2345: Types of parameters 'key' and 'currentValue' are incompatible.
44+
!!! error TS2345: Type 'string' is not assignable to type 'keyof S'.
3845
~~~~~~~~~~~~~~~
3946
!!! error TS2304: Cannot find name 'ClassNameObject'.
4047
const exportedClassName = styles[key];

tests/baselines/reference/strictTypeofUnionNarrowing.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function stringify1(anything: { toString(): string } | undefined): string {
1212
>"string" : "string"
1313
>anything.toUpperCase() : string
1414
>anything.toUpperCase : () => string
15-
>anything : { toString(): string; } & string
15+
>anything : string
1616
>toUpperCase : () => string
1717
>"" : ""
1818
}
@@ -29,7 +29,7 @@ function stringify2(anything: {} | undefined): string {
2929
>"string" : "string"
3030
>anything.toUpperCase() : string
3131
>anything.toUpperCase : () => string
32-
>anything : string & {}
32+
>anything : string
3333
>toUpperCase : () => string
3434
>"" : ""
3535
}
@@ -64,7 +64,7 @@ function stringify4(anything: { toString?(): string } | undefined): string {
6464
>"string" : "string"
6565
>anything.toUpperCase() : string
6666
>anything.toUpperCase : () => string
67-
>anything : {} & string
67+
>anything : string
6868
>toUpperCase : () => string
6969
>"" : ""
7070
}

tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (typeof a === "number") {
1414

1515
let c: number = a;
1616
>c : number
17-
>a : number & {}
17+
>a : number
1818
}
1919
if (typeof a === "string") {
2020
>typeof a === "string" : boolean
@@ -24,7 +24,7 @@ if (typeof a === "string") {
2424

2525
let c: string = a;
2626
>c : string
27-
>a : string & {}
27+
>a : string
2828
}
2929
if (typeof a === "boolean") {
3030
>typeof a === "boolean" : boolean
@@ -34,7 +34,7 @@ if (typeof a === "boolean") {
3434

3535
let c: boolean = a;
3636
>c : boolean
37-
>a : (false & {}) | (true & {})
37+
>a : boolean
3838
}
3939

4040
if (typeof b === "number") {
@@ -45,7 +45,7 @@ if (typeof b === "number") {
4545

4646
let c: number = b;
4747
>c : number
48-
>b : { toString(): string; } & number
48+
>b : number
4949
}
5050
if (typeof b === "string") {
5151
>typeof b === "string" : boolean
@@ -55,7 +55,7 @@ if (typeof b === "string") {
5555

5656
let c: string = b;
5757
>c : string
58-
>b : { toString(): string; } & string
58+
>b : string
5959
}
6060
if (typeof b === "boolean") {
6161
>typeof b === "boolean" : boolean
@@ -65,6 +65,6 @@ if (typeof b === "boolean") {
6565

6666
let c: boolean = b;
6767
>c : boolean
68-
>b : ({ toString(): string; } & false) | ({ toString(): string; } & true)
68+
>b : boolean
6969
}
7070

0 commit comments

Comments
 (0)