39 lines
No EOL
2.3 KiB
Text
39 lines
No EOL
2.3 KiB
Text
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. |