Skip to content

Commit 6038ea0

Browse files
committed
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.
1 parent b4caf64 commit 6038ea0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20339,7 +20339,7 @@ namespace ts {
2033920339
// this allows to rule out cases when both property and indexer are inherited from the base class
2034020340
let errorNode: Node;
2034120341
if (propDeclaration &&
20342-
(getSpecialPropertyAssignmentKind(propDeclaration as BinaryExpression) === SpecialPropertyAssignmentKind.ThisProperty ||
20342+
(propDeclaration.kind === SyntaxKind.BinaryExpression ||
2034320343
propDeclaration.name.kind === SyntaxKind.ComputedPropertyName ||
2034420344
prop.parent === containingType.symbol)) {
2034520345
errorNode = propDeclaration;

0 commit comments

Comments
 (0)