Skip to content

Commit 8d62e26

Browse files
committed
Accept new baselines
1 parent 48d1bee commit 8d62e26

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

tests/baselines/reference/inferFromGenericFunctionReturnTypes3.errors.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts(28,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"bar"'.
2-
tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts(175,47): error TS2322: Type 'boolean' is not assignable to type 'true'.
32
tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts(180,26): error TS2322: Type '{ state: State.A; }[] | { state: State.B; }[]' is not assignable to type '{ state: State.A; }[]'.
43
Type '{ state: State.B; }[]' is not assignable to type '{ state: State.A; }[]'.
54
Type '{ state: State.B; }' is not assignable to type '{ state: State.A; }'.
65
Types of property 'state' are incompatible.
76
Type 'State.B' is not assignable to type 'State.A'.
87

98

10-
==== tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts (3 errors) ====
9+
==== tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts (2 errors) ====
1110
// Repros from #5487
1211

1312
function truePromise(): Promise<true> {
@@ -185,9 +184,6 @@ tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts(180,26): error TS23
185184

186185
declare function foldLeft<U>(z: U, f: (acc: U, t: boolean) => U): U;
187186
let res: boolean = foldLeft(true, (acc, t) => acc && t); // Error
188-
~~~~~~~~
189-
!!! error TS2322: Type 'boolean' is not assignable to type 'true'.
190-
!!! related TS6502 tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts:174:39: The expected type comes from the return type of this signature.
191187

192188
enum State { A, B }
193189
type Foo = { state: State }

tests/baselines/reference/inferFromGenericFunctionReturnTypes3.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,14 @@ declare function foldLeft<U>(z: U, f: (acc: U, t: boolean) => U): U;
461461

462462
let res: boolean = foldLeft(true, (acc, t) => acc && t); // Error
463463
>res : boolean
464-
>foldLeft(true, (acc, t) => acc && t) : true
464+
>foldLeft(true, (acc, t) => acc && t) : boolean
465465
>foldLeft : <U>(z: U, f: (acc: U, t: boolean) => U) => U
466466
>true : true
467-
>(acc, t) => acc && t : (acc: true, t: boolean) => boolean
468-
>acc : true
467+
>(acc, t) => acc && t : (acc: boolean, t: boolean) => boolean
468+
>acc : boolean
469469
>t : boolean
470470
>acc && t : boolean
471-
>acc : true
471+
>acc : boolean
472472
>t : boolean
473473

474474
enum State { A, B }

0 commit comments

Comments
 (0)