This was we don't get noisy baselines just because a different phase of the compiler reported the diagnostic. This helps with Yui's refactoring work to move grammar checks into the type checker.
39 lines
No EOL
1.7 KiB
Text
39 lines
No EOL
1.7 KiB
Text
tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'.
|
|
tests/cases/compiler/createArray.ts(1,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'.
|
|
tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'.
|
|
tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
|
|
|
|
==== tests/cases/compiler/createArray.ts (7 errors) ====
|
|
var na=new number[];
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'number'.
|
|
~~
|
|
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
|
|
class C {
|
|
}
|
|
|
|
new C[];
|
|
~~
|
|
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
var ba=new boolean[];
|
|
~~~~~~~
|
|
!!! error TS2304: Cannot find name 'boolean'.
|
|
~~
|
|
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
var sa=new string[];
|
|
~~~~~~
|
|
!!! error TS2304: Cannot find name 'string'.
|
|
~~
|
|
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
|
function f(s:string):number { return 0;
|
|
}
|
|
if (ba[14]) {
|
|
na[2]=f(sa[3]);
|
|
}
|
|
|
|
new C[1]; // not an error |