17 lines
No EOL
891 B
Text
17 lines
No EOL
891 B
Text
tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts(7,25): error TS2345: Argument of type '(x: A) => A' is not assignable to parameter of type '(x: A) => B'.
|
|
Type 'A' is not assignable to type 'B'.
|
|
Property 'b' is missing in type 'A'.
|
|
|
|
|
|
==== tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts (1 errors) ====
|
|
function f<T, U>(y: T, y1: U, p: (z: U) => T, p1: (x: T) => U): [T, U] { return [y, p1(y)]; }
|
|
interface A { a: A; }
|
|
interface B extends A { b; }
|
|
|
|
var a: A, b: B;
|
|
|
|
var d = f(a, b, x => x, x => x); // A => A not assignable to A => B
|
|
~~~~~~
|
|
!!! error TS2345: Argument of type '(x: A) => A' is not assignable to parameter of type '(x: A) => B'.
|
|
!!! error TS2345: Type 'A' is not assignable to type 'B'.
|
|
!!! error TS2345: Property 'b' is missing in type 'A'. |