=== tests/cases/compiler/inferenceErasedSignatures.ts === // Repro from #37163 declare class SomeBaseClass { >SomeBaseClass : SomeBaseClass set(key: K, value: this[K]): this[K]; >set : (key: K, value: this[K]) => this[K] >key : K >value : this[K] } abstract class SomeAbstractClass extends SomeBaseClass { >SomeAbstractClass : SomeAbstractClass >SomeBaseClass : SomeBaseClass foo!: (r?: R) => void; >foo : (r?: R | undefined) => void >r : R | undefined bar!: (r?: any) => void; >bar : (r?: any) => void >r : any abstract baz(c: C): Promise; >baz : (c: C) => Promise >c : C } class SomeClass extends SomeAbstractClass { >SomeClass : SomeClass >SomeAbstractClass : SomeAbstractClass async baz(context: number): Promise { >baz : (context: number) => Promise >context : number return `${context}`; >`${context}` : string >context : number } } type CType = T extends SomeAbstractClass ? C : never; >CType : CType type MType = T extends SomeAbstractClass ? M : never; >MType : MType type RType = T extends SomeAbstractClass ? R : never; >RType : RType type SomeClassC = CType; // number >SomeClassC : number type SomeClassM = MType; // string >SomeClassM : string type SomeClassR = RType; // boolean >SomeClassR : boolean // Repro from #37163 interface BaseType { set(key: K, value: this[K]): this[K]; >set : (key: K, value: this[K]) => this[K] >key : K >value : this[K] useT1(c: T1): void; >useT1 : (c: T1) => void >c : T1 useT2(r?: T2): void; >useT2 : (r?: T2 | undefined) => void >r : T2 | undefined unrelatedButSomehowRelevant(r?: any): void; >unrelatedButSomehowRelevant : (r?: any) => void >r : any } interface InheritedType extends BaseType { // This declaration shouldn't do anything... useT1(_: number): void >useT1 : (_: number) => void >_ : number } // Structural expansion of InheritedType interface StructuralVersion { set(key: K, value: this[K]): this[K]; >set : (key: K, value: this[K]) => this[K] >key : K >value : this[K] useT1(c: number): void; >useT1 : (c: number) => void >c : number useT2(r?: boolean): void; >useT2 : (r?: boolean | undefined) => void >r : boolean | undefined unrelatedButSomehowRelevant(r?: any): void; >unrelatedButSomehowRelevant : (r?: any) => void >r : any } type GetT1 = T extends BaseType ? U : never; >GetT1 : GetT1 type T1 = GetT1; // number >T1 : number type T2 = GetT1; // number >T2 : number