30 lines
No EOL
1.1 KiB
Text
30 lines
No EOL
1.1 KiB
Text
tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(2,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
|
tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(4,14): error TS2314: Generic type 'Array<T>' requires 1 type argument(s).
|
|
|
|
|
|
==== tests/cases/compiler/genericArrayAssignmentCompatErrors.ts (2 errors) ====
|
|
var myCars=new Array();
|
|
var myCars2 = new [];
|
|
~~~~~~
|
|
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
|
var myCars3 = new Array({});
|
|
var myCars4: Array; // error
|
|
~~~~~
|
|
!!! error TS2314: Generic type 'Array<T>' requires 1 type argument(s).
|
|
var myCars5: Array<any>[];
|
|
|
|
myCars = myCars2;
|
|
myCars = myCars3;
|
|
myCars = myCars4;
|
|
myCars = myCars5;
|
|
|
|
myCars2 = myCars;
|
|
myCars2 = myCars3;
|
|
myCars2 = myCars4;
|
|
myCars2 = myCars5;
|
|
|
|
myCars3 = myCars;
|
|
myCars3 = myCars2;
|
|
myCars3 = myCars4;
|
|
myCars3 = myCars5;
|
|
|