TypeScript/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.errors.txt

17 lines
884 B
Plaintext

tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts(7,29): error TS2345: Argument of type '(t2: A) => A' is not assignable to parameter of type '(t2: A) => B'.
Type 'A' is not assignable to type 'B'.
Property 'b' is missing in type 'A'.
==== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments3.ts (1 errors) ====
function f<T, U>(t1: T, u1: U, pf1: (u2: U) => T, pf2: (t2: T) => U): [T, U] { return [t1, pf2(t1)]; }
interface A { a: A; }
interface B extends A { b: B; }
var a: A, b: B;
var d = f(a, b, u2 => u2.b, t2 => t2);
~~~~~~~~
!!! error TS2345: Argument of type '(t2: A) => A' is not assignable to parameter of type '(t2: A) => B'.
!!! error TS2345: Type 'A' is not assignable to type 'B'.
!!! error TS2345: Property 'b' is missing in type 'A'.