// @strict: true
// Repro from #28862
type Foo = { type: "foo", (): A[] };
type Bar = { type: "bar", (): A };
type FooBar = Foo | Bar;
type InferA = T extends FooBar ? A : never;
type FooA = InferA>; // number
// Repro from #28862
type Item = { kind: 'a', data: T } | { kind: 'b', data: T[] };
declare function foo(item: Item): T;
let x1 = foo({ kind: 'a', data: 42 }); // number
let x2 = foo({ kind: 'b', data: [1, 2] }); // number