=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance4.ts === // checking subtype relations for function types as it relates to contextual signature instantiation class Base { foo: string; } >Base : Base >foo : string class Derived extends Base { bar: string; } >Derived : Derived >Base : Base >bar : string class Derived2 extends Derived { baz: string; } >Derived2 : Derived2 >Derived : Derived >baz : string class OtherDerived extends Base { bing: string; } >OtherDerived : OtherDerived >Base : Base >bing : string interface A { // T >A : A // M's a: (x: T) => T[]; >a : (x: T) => T[] >T : T >x : T >T : T >T : T a2: (x: T) => string[]; >a2 : (x: T) => string[] >T : T >x : T >T : T a3: (x: T) => void; >a3 : (x: T) => void >T : T >x : T >T : T a4: (x: T, y: U) => string; >a4 : (x: T, y: U) => string >T : T >U : U >x : T >T : T >y : U >U : U a5: (x: (arg: T) => U) => T; >a5 : (x: (arg: T) => U) => T >T : T >U : U >x : (arg: T) => U >arg : T >T : T >U : U >T : T a6: (x: (arg: T) => Derived) => T; >a6 : (x: (arg: T) => Derived) => T >T : T >Base : Base >x : (arg: T) => Derived >arg : T >T : T >Derived : Derived >T : T a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : (x: { foo: T; }, y: { foo: T; bar: T; }) => Base >T : T >x : { foo: T; } >foo : T >T : T >y : { foo: T; bar: T; } >foo : T >T : T >bar : T >T : T >Base : Base a15: (x: { a: T; b: T }) => T[]; >a15 : (x: { a: T; b: T; }) => T[] >T : T >x : { a: T; b: T; } >a : T >T : T >b : T >T : T >T : T a16: (x: { a: T; b: T }) => T[]; >a16 : (x: { a: T; b: T; }) => T[] >T : T >Base : Base >x : { a: T; b: T; } >a : T >T : T >b : T >T : T >T : T a17: { >a17 : { (x: (a: T) => T): T[]; (x: (a: T) => T): T[]; } (x: (a: T) => T): T[]; >T : T >Derived : Derived >x : (a: T) => T >a : T >T : T >T : T >T : T (x: (a: T) => T): T[]; >T : T >Base : Base >x : (a: T) => T >a : T >T : T >T : T >T : T }; a18: { >a18 : { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; } (x: { >x : { (a: T): T; (a: T): T; } (a: T): T; >T : T >Derived : Derived >a : T >T : T >T : T (a: T): T; >T : T >Base : Base >a : T >T : T >T : T }): any[]; (x: { >x : { (a: T): T; (a: T): T; } (a: T): T; >T : T >Derived2 : Derived2 >a : T >T : T >T : T (a: T): T; >T : T >Base : Base >a : T >T : T >T : T }): any[]; }; } // S's interface I extends A { >I : I >A : A // N's a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number >a : (x: T) => T[] >T : T >x : T >T : T >T : T a2: (x: T) => string[]; // ok >a2 : (x: T) => string[] >T : T >x : T >T : T a3: (x: T) => T; // ok since Base returns void >a3 : (x: T) => T >T : T >x : T >T : T >T : T a4: (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number >a4 : (x: T, y: U) => string >T : T >U : U >x : T >T : T >y : U >U : U a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made >a5 : (x: (arg: T) => U) => T >T : T >U : U >x : (arg: T) => U >arg : T >T : T >U : U >T : T a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy >a6 : (x: (arg: T) => U) => T >T : T >Base : Base >U : U >Derived : Derived >x : (arg: T) => U >arg : T >T : T >U : U >T : T a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok >a11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base >T : T >U : U >x : { foo: T; } >foo : T >T : T >y : { foo: U; bar: U; } >foo : U >U : U >bar : U >U : U >Base : Base a15: (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V >a15 : (x: { a: U; b: V; }) => U[] >U : U >V : V >x : { a: U; b: V; } >a : U >U : U >b : V >V : V >U : U a16: (x: { a: T; b: T }) => T[]; // ok, more general parameter type >a16 : (x: { a: T; b: T; }) => T[] >T : T >x : { a: T; b: T; } >a : T >T : T >b : T >T : T >T : T a17: (x: (a: T) => T) => T[]; // ok >a17 : (x: (a: T) => T) => T[] >T : T >x : (a: T) => T >a : T >T : T >T : T >T : T a18: (x: (a: T) => T) => any[]; // ok >a18 : (x: (a: T) => T) => any[] >x : (a: T) => T >T : T >a : T >T : T >T : T }