Skip to content

Commit ad71da0

Browse files
committed
Fix error reporting bug
1 parent c16c7d5 commit ad71da0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18240,14 +18240,14 @@ namespace ts {
1824018240
const propDeclaration = prop.valueDeclaration;
1824118241

1824218242
// index is numeric and property name is not valid numeric literal
18243-
if (indexKind === IndexKind.Number && propDeclaration && !isNumericName(propDeclaration.name)) {
18243+
if (indexKind === IndexKind.Number && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) {
1824418244
return;
1824518245
}
1824618246

1824718247
// perform property check if property or indexer is declared in 'type'
1824818248
// this allows to rule out cases when both property and indexer are inherited from the base class
1824918249
let errorNode: Node;
18250-
if (propDeclaration && propDeclaration.name.kind === SyntaxKind.ComputedPropertyName || prop.parent === containingType.symbol) {
18250+
if (propDeclaration && (propDeclaration.name.kind === SyntaxKind.ComputedPropertyName || prop.parent === containingType.symbol)) {
1825118251
errorNode = propDeclaration;
1825218252
}
1825318253
else if (indexDeclaration) {

0 commit comments

Comments
 (0)