File: typeAssertionToGenericFunctionType.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (16 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,3): error TS2554: Expected 1 arguments, but got 0.


==== tests/cases/compiler/typeAssertionToGenericFunctionType.ts (2 errors) ====
    var x = {
        a: < <T>(x: T) => T > ((x: any) => 1),
        b: <T>(x: T) => { x }
    }
    x.a<string>(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition
                ~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
    x.b<string>(); // error
      ~~~~~~~~~~~
!!! error TS2554: Expected 1 arguments, but got 0.
!!! related TS6210 tests/cases/compiler/typeAssertionToGenericFunctionType.ts:3:12: An argument for 'x' was not provided.