// @strict: true // @target: esnext // Repro from #30720 type Maybe = T | undefined; declare function concatMaybe(...args: (Maybe | Maybe[])[]): T[]; concatMaybe([1, 2, 3], 4); // Repros from #32247 const g: (com: () => Iterator | AsyncIterator) => Promise = async (com: () => Iterator | AsyncIterator): Promise => { throw com; }; interface Foo1 { test(value: T): void; } interface Bar1 { test(value: T | PromiseLike): void; } declare let f1: (x: Foo1 | Bar1) => Promise; declare let f2: (x: Foo1 | Bar1) => Promise; f1 = f2; f2 = f1; type Foo2 = { test(value: T): void; } type Bar2 = { test(value: T | PromiseLike): void; } declare let g1: (x: Foo2 | Bar2) => Promise; declare let g2: (x: Foo2 | Bar2) => Promise; g1 = g2; g2 = g1; // Repro from #32572 declare function foo1(obj: string[] & Iterable): T; declare function foo2(obj: string[] & T): T; declare let sa: string[]; declare let sx: string[] & { extra: number }; let x1 = foo1(sa); // string let y1 = foo1(sx); // string let x2 = foo2(sa); // unknown let y2 = foo2(sx); // { extra: number } // Repro from #33490 declare class Component

{ props: P } export type ComponentClass

= new (props: P) => Component

; export type FunctionComponent

= (props: P) => null; export type ComponentType

= FunctionComponent

| ComponentClass

; export interface RouteComponentProps { route: string } declare function withRouter< P extends RouteComponentProps, C extends ComponentType

>( component: C & ComponentType

): ComponentClass>; interface Props extends RouteComponentProps { username: string } declare const MyComponent: ComponentType; withRouter(MyComponent); // Repro from #33490 type AB = { a: T } | { b: T }; // T & AB normalizes to T & { a: U } | T & { b: U } below declare function foo(obj: T & AB): [T, U]; declare let ab: AB; let z = foo(ab); // [AB, string]