The predicate function should narrowed to Foo | Bar but it actually narrowed to Foo in the following case
type Predicate<T> = (x: unknown) => x is T;
type Foo = {
foo: string;
};
type Bar = {
foo: string;
bar?: string;
};
type F = Predicate<Foo>;
type B = Predicate<Bar>;
// Please fix this definition.
type OneOf<T extends Predicate<unknown>[]> = T extends Predicate<infer U>[] ? U : never;
const a: OneOf<[F, B]> = {foo: "", bar: ""}; // `a` is not `Foo | Bar` but `Foo` so this assignment fails.
I'm not sure if this is TypeScript limitation but you can play this with TS Playground.