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.
This commit is contained in:
Nathan Shively-Sanders 2017-05-08 10:40:24 -07:00
parent b4caf646ea
commit 6038ea09c9

View file

@ -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;