mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-29 19:42:39 -05:00
Add breaking change repros
This commit is contained in:
@@ -172,3 +172,13 @@ const f1: F = () => {
|
||||
}
|
||||
]);
|
||||
};
|
||||
|
||||
// Breaking change repros from #29478
|
||||
|
||||
declare function foldLeft<U>(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<T>(f: () => T[]): T[];
|
||||
let x: Foo[] = bar(() => !!true ? [{ state: State.A }] : [{ state: State.B }]); // Error
|
||||
|
||||
Reference in New Issue
Block a user