Skip to content

Commit db3e062

Browse files
committed
Change diagnostic wording
1 parent da5eb1a commit db3e062

8 files changed

+18
-18
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@
14931493
"category": "Message",
14941494
"code": 1476
14951495
},
1496-
"Instantiation expression cannot be followed by property access.": {
1496+
"An instantiation expression cannot be followed by a property access.": {
14971497
"category": "Error",
14981498
"code": 1477
14991499
},

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5649,7 +5649,7 @@ namespace ts {
56495649
if (isExpressionWithTypeArguments(expression) && expression.typeArguments) {
56505650
const pos = expression.typeArguments.pos - 1;
56515651
const end = skipTrivia(sourceText, expression.typeArguments.end) + 1;
5652-
parseErrorAt(pos, end, Diagnostics.Instantiation_expression_cannot_be_followed_by_property_access);
5652+
parseErrorAt(pos, end, Diagnostics.An_instantiation_expression_cannot_be_followed_by_a_property_access);
56535653
}
56545654
return finishNode(propertyAccess, pos);
56555655
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/genericCallWithoutArgs.ts(4,2): error TS1477: Instantiation expression cannot be followed by property access.
1+
tests/cases/compiler/genericCallWithoutArgs.ts(4,2): error TS1477: An instantiation expression cannot be followed by a property access.
22
tests/cases/compiler/genericCallWithoutArgs.ts(4,18): error TS1003: Identifier expected.
33

44

@@ -8,6 +8,6 @@ tests/cases/compiler/genericCallWithoutArgs.ts(4,18): error TS1003: Identifier e
88

99
f<number,string>.
1010
~~~~~~~~~~~~~~~
11-
!!! error TS1477: Instantiation expression cannot be followed by property access.
11+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
1212

1313
!!! error TS1003: Identifier expected.

tests/baselines/reference/instantiationExpressionErrors.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(7,13): error TS1477: Instantiation expression cannot be followed by property access.
2-
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(8,13): error TS1477: Instantiation expression cannot be followed by property access.
1+
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(7,13): error TS1477: An instantiation expression cannot be followed by a property access.
2+
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(8,13): error TS1477: An instantiation expression cannot be followed by a property access.
33
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(13,12): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string[]'.
44
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(13,14): error TS2693: 'number' only refers to a type, but is being used as a value here.
55
tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpressionErrors.ts(18,12): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'.
@@ -25,10 +25,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiationExpr
2525
const a2 = f.g<number>; // () => number
2626
const a3 = f<number>.g; // <U>() => U
2727
~~~~~~~~
28-
!!! error TS1477: Instantiation expression cannot be followed by property access.
28+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
2929
const a4 = f<number>.g<number>; // () => number
3030
~~~~~~~~
31-
!!! error TS1477: Instantiation expression cannot be followed by property access.
31+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
3232
const a5 = f['g']<number>; // () => number
3333

3434
// `[` is an expression starter and cannot immediately follow a type argument list

tests/baselines/reference/optionalChainWithInstantiationExpression1(target=es2019).errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/optionalChainWithInstantiationExpression1.ts(12,5): error TS1477: Instantiation expression cannot be followed by property access.
1+
tests/cases/compiler/optionalChainWithInstantiationExpression1.ts(12,5): error TS1477: An instantiation expression cannot be followed by a property access.
22

33

44
==== tests/cases/compiler/optionalChainWithInstantiationExpression1.ts (1 errors) ====
@@ -15,7 +15,7 @@ tests/cases/compiler/optionalChainWithInstantiationExpression1.ts(12,5): error T
1515

1616
a?.b<c>.d;
1717
~~~
18-
!!! error TS1477: Instantiation expression cannot be followed by property access.
18+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
1919

2020
a?.b.d
2121

tests/baselines/reference/optionalChainWithInstantiationExpression1(target=es2020).errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/optionalChainWithInstantiationExpression1.ts(12,5): error TS1477: Instantiation expression cannot be followed by property access.
1+
tests/cases/compiler/optionalChainWithInstantiationExpression1.ts(12,5): error TS1477: An instantiation expression cannot be followed by a property access.
22

33

44
==== tests/cases/compiler/optionalChainWithInstantiationExpression1.ts (1 errors) ====
@@ -15,7 +15,7 @@ tests/cases/compiler/optionalChainWithInstantiationExpression1.ts(12,5): error T
1515

1616
a?.b<c>.d;
1717
~~~
18-
!!! error TS1477: Instantiation expression cannot be followed by property access.
18+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
1919

2020
a?.b.d
2121

tests/baselines/reference/parserMemberAccessExpression1.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression
33
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(2,1): error TS2304: Cannot find name 'Foo'.
44
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(2,9): error TS2304: Cannot find name 'T'.
55
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(3,1): error TS2304: Cannot find name 'Foo'.
6-
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(3,4): error TS1477: Instantiation expression cannot be followed by property access.
6+
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(3,4): error TS1477: An instantiation expression cannot be followed by a property access.
77
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(4,1): error TS2304: Cannot find name 'Foo'.
8-
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(4,4): error TS1477: Instantiation expression cannot be followed by property access.
8+
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(4,4): error TS1477: An instantiation expression cannot be followed by a property access.
99
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression1.ts(4,12): error TS2304: Cannot find name 'T'.
1010

1111

@@ -24,12 +24,12 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessExpression
2424
~~~
2525
!!! error TS2304: Cannot find name 'Foo'.
2626
~~~
27-
!!! error TS1477: Instantiation expression cannot be followed by property access.
27+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
2828
Foo<T>.Bar<T>();
2929
~~~
3030
!!! error TS2304: Cannot find name 'Foo'.
3131
~~~
32-
!!! error TS1477: Instantiation expression cannot be followed by property access.
32+
!!! error TS1477: An instantiation expression cannot be followed by a property access.
3333
~
3434
!!! error TS2304: Cannot find name 'T'.
3535

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessOffOfGenericType1.ts(1,9): error TS2304: Cannot find name 'List'.
2-
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessOffOfGenericType1.ts(1,13): error TS1477: Instantiation expression cannot be followed by property access.
2+
tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessOffOfGenericType1.ts(1,13): error TS1477: An instantiation expression cannot be followed by a property access.
33

44

55
==== tests/cases/conformance/parser/ecmascript5/Generics/parserMemberAccessOffOfGenericType1.ts (2 errors) ====
66
var v = List<number>.makeChild();
77
~~~~
88
!!! error TS2304: Cannot find name 'List'.
99
~~~~~~~~
10-
!!! error TS1477: Instantiation expression cannot be followed by property access.
10+
!!! error TS1477: An instantiation expression cannot be followed by a property access.

0 commit comments

Comments
 (0)