File: typeAssertionToGenericFunctionType.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 (15 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target.


==== 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 '1' is not assignable to parameter of type 'string'.
    x.b<string>(); // error
    ~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.