mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Move errors about "new Foo[]" to the grammar checker.
This commit is contained in:
+14
-3
@@ -1028,8 +1028,8 @@ module ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
function createMissingNode(): Node {
|
||||
return createNode(SyntaxKind.Missing);
|
||||
function createMissingNode(pos?: number): Node {
|
||||
return createNode(SyntaxKind.Missing, pos);
|
||||
}
|
||||
|
||||
function internIdentifier(text: string): string {
|
||||
@@ -2254,7 +2254,6 @@ module ts {
|
||||
// Check for that common pattern and report a better error message.
|
||||
if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) {
|
||||
indexedAccess.index = createMissingNode();
|
||||
errorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
|
||||
}
|
||||
else {
|
||||
indexedAccess.index = parseExpression();
|
||||
@@ -3725,6 +3724,7 @@ module ts {
|
||||
case SyntaxKind.FunctionExpression: return visitFunctionExpression(<FunctionExpression>node);
|
||||
case SyntaxKind.FunctionType: return visitFunctionType(<SignatureDeclaration>node);
|
||||
case SyntaxKind.GetAccessor: return visitGetAccessor(<MethodDeclaration>node);
|
||||
case SyntaxKind.IndexedAccess: return visitIndexedAccess(<IndexedAccess>node);
|
||||
case SyntaxKind.IndexSignature: return visitIndexSignature(<SignatureDeclaration>node);
|
||||
case SyntaxKind.InterfaceDeclaration: return visitInterfaceDeclaration(<InterfaceDeclaration>node);
|
||||
case SyntaxKind.LabeledStatement: return visitLabeledStatement(<LabeledStatement>node);
|
||||
@@ -4123,6 +4123,17 @@ module ts {
|
||||
checkAccessor(node);
|
||||
}
|
||||
|
||||
function visitIndexedAccess(node: IndexedAccess): void {
|
||||
if (node.index.kind === SyntaxKind.Missing &&
|
||||
node.parent.kind === SyntaxKind.NewExpression &&
|
||||
(<NewExpression>node.parent).func === node) {
|
||||
|
||||
var start = skipTrivia(sourceText, node.parent.pos);
|
||||
var end = node.end;
|
||||
grammarErrorAtPos(start, end - start, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
|
||||
}
|
||||
}
|
||||
|
||||
function visitIndexSignature(node: SignatureDeclaration): void {
|
||||
checkIndexSignatureParameters(node);
|
||||
}
|
||||
|
||||
@@ -1,32 +1,29 @@
|
||||
tests/cases/compiler/badArraySyntax.ts(6,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(7,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(8,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(9,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(10,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(10,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(6,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(7,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(8,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(9,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
|
||||
==== tests/cases/compiler/badArraySyntax.ts (6 errors) ====
|
||||
==== tests/cases/compiler/badArraySyntax.ts (5 errors) ====
|
||||
class Z {
|
||||
public x = "";
|
||||
}
|
||||
|
||||
var a1: Z[] = [];
|
||||
var a2 = new Z[];
|
||||
~~
|
||||
~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a3 = new Z[]();
|
||||
~~
|
||||
~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a4: Z[] = new Z[];
|
||||
~~
|
||||
~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a5: Z[] = new Z[]();
|
||||
~~
|
||||
~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a6: Z[][] = new Z [ ] [ ];
|
||||
~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,21): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,9): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Property 'ClassA' does not exist on type 'typeof M'.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Pr
|
||||
class ClassA {}
|
||||
}
|
||||
var t = new M.ClassA[];
|
||||
~~
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'.
|
||||
@@ -1,7 +1,7 @@
|
||||
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,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
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(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(6,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(7,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(8,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'.
|
||||
tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'.
|
||||
@@ -9,7 +9,7 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin
|
||||
|
||||
==== tests/cases/compiler/createArray.ts (7 errors) ====
|
||||
var na=new number[];
|
||||
~~
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'number'.
|
||||
@@ -18,15 +18,15 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin
|
||||
}
|
||||
|
||||
new C[];
|
||||
~~
|
||||
~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var ba=new boolean[];
|
||||
~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'boolean'.
|
||||
var sa=new string[];
|
||||
~~
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/libMembers.ts(9,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/libMembers.ts(9,11): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/libMembers.ts(4,3): error TS2339: Property 'subby' does not exist on type 'string'.
|
||||
tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type 'C'.
|
||||
|
||||
@@ -15,7 +15,7 @@ tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' do
|
||||
export class C {
|
||||
}
|
||||
var a=new C[];
|
||||
~~
|
||||
~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
a.length;
|
||||
a.push(new C());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/newOperator.ts(18,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(45,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'.
|
||||
tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/newOperator.ts(11,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -38,14 +38,16 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with
|
||||
|
||||
// Various spacing
|
||||
var t3 = new string[]( );
|
||||
~~
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
var t4 =
|
||||
new
|
||||
~~~
|
||||
string
|
||||
~~~~~~
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
[
|
||||
~
|
||||
@@ -78,7 +80,7 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with
|
||||
class S {
|
||||
public get xs(): M.T[] {
|
||||
return new M.T[];
|
||||
~~
|
||||
~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,5): error TS2304: Cannot find name 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts (2 errors) ====
|
||||
new Foo[];
|
||||
~~
|
||||
~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,5): error TS2304: Cannot find name 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts (2 errors) ====
|
||||
new Foo[]();
|
||||
~~
|
||||
~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,32): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,36): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,41): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,35): error TS2304: Cannot find name 'boolean'.
|
||||
@@ -472,20 +472,20 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error
|
||||
}
|
||||
|
||||
export var tokenTable = new TokenInfo[];
|
||||
~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
export var nodeTypeTable = new string[];
|
||||
~~
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
export var nodeTypeToTokTable = new number[];
|
||||
~~
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'number'.
|
||||
export var noRegexTable = new boolean[];
|
||||
~~
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'boolean'.
|
||||
@@ -1474,7 +1474,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error
|
||||
|
||||
// TODO: new with length TokenID.LimFixed
|
||||
export var staticTokens = new Token[];
|
||||
~~
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
export function initializeStaticTokens() {
|
||||
for (var i = 0; i <= TokenID.LimFixed; i++) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(867,29): error TS1015: Parameter cannot have question mark and initializer.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'.
|
||||
@@ -514,7 +515,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,30): error
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (514 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts (515 errors) ====
|
||||
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
|
||||
// See LICENSE.txt in the project root for complete license information.
|
||||
|
||||
@@ -792,7 +793,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'SymbolScope'.
|
||||
public members: AST[] = new AST[];
|
||||
~~
|
||||
~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
constructor () {
|
||||
@@ -1814,6 +1815,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
}
|
||||
|
||||
public getAliasName(aliasAST?: AST = this.alias) : string {
|
||||
~~~~~~~~
|
||||
!!! error TS1015: Parameter cannot have question mark and initializer.
|
||||
if (aliasAST.nodeType == NodeType.Name) {
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'NodeType'.
|
||||
@@ -2026,7 +2029,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
!!! error TS2304: Cannot find name 'Symbol'.
|
||||
if (this.envids == null) {
|
||||
this.envids = new Identifier[];
|
||||
~~
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
}
|
||||
this.envids[this.envids.length] = id;
|
||||
@@ -2045,7 +2048,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
!!! error TS2304: Cannot find name 'Symbol'.
|
||||
if (this.jumpRefs == null) {
|
||||
this.jumpRefs = new Identifier[];
|
||||
~~
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
}
|
||||
var id = new Identifier(sym.name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,24): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts (2 errors) ====
|
||||
@@ -200,7 +200,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error T
|
||||
export class HashTable {
|
||||
public itemCount: number = 0;
|
||||
public table = new HashEntry[];
|
||||
~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
constructor (public size: number, public hashFn: (key) =>number,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,37): error TS2304: Cannot find name 'TypeLink'.
|
||||
@@ -326,7 +326,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
|
||||
var len = bases.members.length;
|
||||
if (baseTypeLinks == null) {
|
||||
baseTypeLinks = new TypeLink[];
|
||||
~~
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'TypeLink'.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,39): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'.
|
||||
@@ -56,7 +56,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error T
|
||||
!!! error TS2304: Cannot find name 'Type'.
|
||||
if (typeLinks) {
|
||||
extendsList = new Type[];
|
||||
~~
|
||||
~~~~~~~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'Type'.
|
||||
|
||||
Reference in New Issue
Block a user