File: instantiateNonGenericTypeWithTypeArguments.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (33 lines) | stat: -rw-r--r-- 1,574 bytes parent folder | download | duplicates (5)
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
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,15): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,17): error TS2558: Expected 0 type arguments, but got 1.
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,16): error TS2558: Expected 0 type arguments, but got 1.
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 (4 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 TS2558: Expected 0 type arguments, but got 1.
    
    function Foo(): void { }
    var r = new Foo<number>();
                    ~~~~~~
!!! error TS2558: Expected 0 type arguments, but got 1.
    
    var f: { (): void };
    var r2 = new f<number>();
                   ~~~~~~
!!! error TS2558: Expected 0 type arguments, but got 1.
    
    var a: any;
    // BUG 790977
    var r2 = new a<number>();
             ~~~~~~~~~~~~~~~
!!! error TS2347: Untyped function calls may not accept type arguments.