Skip to content

Commit a366984

Browse files
Reassigned diagnostic codes.
1 parent 5c59360 commit a366984

24 files changed

+970
-969
lines changed

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 257 additions & 257 deletions
Large diffs are not rendered by default.

src/compiler/diagnosticMessages.json

Lines changed: 649 additions & 647 deletions
Large diffs are not rendered by default.

src/compiler/parser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,13 +1977,12 @@ module ts {
19771977
var indexedAccess = <IndexedAccess>createNode(SyntaxKind.IndexedAccess, expr.pos);
19781978
indexedAccess.object = expr;
19791979

1980-
// It's not uncommon for a user to write: "new Type[]". Check for that common pattern
1981-
// and report a better error message.
1980+
// It's not uncommon for a user to write: "new Type[]".
1981+
// Check for that common pattern and report a better error message.
19821982
if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) {
19831983
indexedAccess.index = createMissingNode();
19841984
grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
19851985
}
1986-
// Otherwise parse the indexed access normally.
19871986
else {
19881987
indexedAccess.index = parseExpression();
19891988
parseExpected(SyntaxKind.CloseBracketToken);

tests/baselines/reference/ExportAssignment7.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
export = B;
88
~~~~~~~~~~~
9-
!!! An export assignment cannot be used in a module with other exported elements.
9+
!!! Cannot find name 'B'.
1010
~~~~~~~~~~~
11-
!!! Cannot find name 'B'.
11+
!!! An export assignment cannot be used in a module with other exported elements.

tests/baselines/reference/ExportAssignment8.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
~~~~~~~~~~~
44
!!! Cannot compile external modules unless the '--module' flag is provided.
55
~~~~~~~~~~~
6-
!!! An export assignment cannot be used in a module with other exported elements.
7-
~~~~~~~~~~~
86
!!! Cannot find name 'B'.
7+
~~~~~~~~~~~
8+
!!! An export assignment cannot be used in a module with other exported elements.
99

1010
export class C {
1111
}

tests/baselines/reference/arrowFunctionContexts.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// Arrow function used in with statement
44
with (window) {
55
~~~~~~
6-
!!! All symbols within a 'with' block will be resolved to 'any'.
7-
~~~~~~
86
!!! Cannot find name 'window'.
7+
~~~~~~
8+
!!! All symbols within a 'with' block will be resolved to 'any'.
99
var p = () => this;
1010
}
1111

@@ -54,9 +54,9 @@
5454
// Arrow function used in with statement
5555
with (window) {
5656
~~~~~~
57-
!!! All symbols within a 'with' block will be resolved to 'any'.
58-
~~~~~~
5957
!!! Cannot find name 'window'.
58+
~~~~~~
59+
!!! All symbols within a 'with' block will be resolved to 'any'.
6060
var p = () => this;
6161
}
6262

tests/baselines/reference/callOverloads1.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
function Foo(); // error
1111
~~~
12-
!!! Function implementation is missing or not immediately following the declaration.
13-
~~~
1412
!!! Duplicate identifier 'Foo'.
13+
~~~
14+
!!! Function implementation is missing or not immediately following the declaration.
1515
function F1(s:string);
1616
function F1(a:any) { return a;}
1717

tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
interface Derived extends Base {
88
1: { y: number } // error
99
~~~~~~~~~~~~~~~~
10-
!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
11-
~~~~~~~~~~~~~~~~
1210
!!! Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'.
11+
~~~~~~~~~~~~~~~~
12+
!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
1313
}
1414

1515
interface Derived2 extends Base {
1616
'1': { y: number } // error
1717
~~~~~~~~~~~~~~~~~~
18-
!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
19-
~~~~~~~~~~~~~~~~~~
2018
!!! Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'.
19+
~~~~~~~~~~~~~~~~~~
20+
!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
2121
}
2222

2323
interface Derived3 extends Base {

tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
~
99
!!! Type parameter list cannot be empty.
1010
~
11-
!!! Type parameter declaration expected.
12-
~
1311
!!! '(' expected.
12+
~
13+
!!! Type parameter declaration expected.
1414
};
1515
~
1616
!!! Expression expected.

tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
module M {
7070
module F {
7171
~
72-
!!! A module declaration cannot be located prior to a class or function with which it is merged
73-
~
7472
!!! Individual declarations in merged declaration F must be all exported or all local.
73+
~
74+
!!! A module declaration cannot be located prior to a class or function with which it is merged
7575
var t;
7676
}
7777
export function F() { } // Only one error for duplicate identifier (don't consider visibility)

0 commit comments

Comments
 (0)