diff --git a/tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts b/tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts index e44e7c4a5e0..429d98b6a39 100644 --- a/tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts +++ b/tests/cases/compiler/inferFromGenericFunctionReturnTypes3.ts @@ -172,3 +172,13 @@ const f1: F = () => { } ]); }; + +// Breaking change repros from #29478 + +declare function foldLeft(z: U, f: (acc: U, t: boolean) => U): U; +let res: boolean = foldLeft(true, (acc, t) => acc && t); // Error + +enum State { A, B } +type Foo = { state: State } +declare function bar(f: () => T[]): T[]; +let x: Foo[] = bar(() => !!true ? [{ state: State.A }] : [{ state: State.B }]); // Error