File: typeParameterFixingWithContextSensitiveArguments2.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (15 lines) | stat: -rw-r--r-- 925 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts(7,30): error TS2741: Property 'b' is missing in type 'A' but required in type 'B'.


==== 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 TS2741: Property 'b' is missing in type 'A' but required in type 'B'.
!!! related TS2728 tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts:3:25: 'b' is declared here.
!!! related TS6502 tests/cases/compiler/typeParameterFixingWithContextSensitiveArguments2.ts:1:51: The expected type comes from the return type of this signature.