From 6038ea09c9e80972ac37817dd69044e8bd187f30 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 8 May 2017 10:40:24 -0700 Subject: [PATCH] Simplify JS check in index constraint error reporting Any declaration that is a BinaryExpression is a special javascript declaration, and all JS declarations that are checked for index constraint compatibility are, in fact, relevant. --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d3e2233bc44..a93585156bb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20339,7 +20339,7 @@ namespace ts { // this allows to rule out cases when both property and indexer are inherited from the base class let errorNode: Node; if (propDeclaration && - (getSpecialPropertyAssignmentKind(propDeclaration as BinaryExpression) === SpecialPropertyAssignmentKind.ThisProperty || + (propDeclaration.kind === SyntaxKind.BinaryExpression || propDeclaration.name.kind === SyntaxKind.ComputedPropertyName || prop.parent === containingType.symbol)) { errorNode = propDeclaration;