File: instantiateNonGenericTypeWithTypeArguments.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 (39 lines) | stat: -rw-r--r-- 2,329 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,9): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,10): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(18,10): error TS2347: Untyped function calls may not accept type arguments.


==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts (6 errors) ====
    // it is an error to provide type arguments to a non-generic call
    // all of these are errors
    
    class C {
        x: string;
    }
    
    var c = new C<number>();
            ~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
    
    function Foo(): void { }
    var r = new Foo<number>();
            ~~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
            ~~~~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
    
    var f: { (): void };
    var r2 = new f<number>();
             ~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
             ~~~~~~~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
    
    var a: any;
    // BUG 790977
    var r2 = new a<number>();
             ~~~~~~~~~~~~~~~
!!! error TS2347: Untyped function calls may not accept type arguments.