// @strict: true // Repro from #30050 interface Obj { ref: T; } interface Func { (x: T): void; } type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; type CtorOf = (arg: UnionToIntersection) => T; interface Big { "0": { common?: string; "0"?: number, ref?: Obj | Func; } "1": { common?: string; "1"?: number, ref?: Obj | Func; } "2": { common?: string; "2"?: number, ref?: Obj | Func; } "3": { common?: string; "3"?: number, ref?: Obj | Func; } "4": { common?: string; "4"?: number, ref?: Obj | Func; } "5": { common?: string; "5"?: number, ref?: Obj | Func; } "6": { common?: string; "6"?: number, ref?: Obj | Func; } "7": { common?: string; "7"?: number, ref?: Obj | Func; } "8": { common?: string; "8"?: number, ref?: Obj | Func; } "9": { common?: string; "9"?: number, ref?: Obj | Func; } "10": { common?: string; "10"?: number, ref?: Obj | Func; } "11": { common?: string; "11"?: number, ref?: Obj | Func; } "12": { common?: string; "12"?: number, ref?: Obj | Func; } "13": { common?: string; "13"?: number, ref?: Obj | Func; } "14": { common?: string; "14"?: number, ref?: Obj | Func; } "15": { common?: string; "15"?: number, ref?: Obj | Func; } "16": { common?: string; "16"?: number, ref?: Obj | Func; } "17": { common?: string; "17"?: number, ref?: Obj | Func; } } declare function getCtor(comp: T): CtorOf declare var all: keyof Big; const ctor = getCtor(all); const comp = ctor({ common: "ok", ref: x => console.log(x) });