mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user