File: typeParameterFixingWithContextSensitiveArguments2.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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'.