Skip to content

Commit b2cfaf8

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 03da13c commit b2cfaf8

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
@@ -20206,7 +20206,7 @@ namespace ts {
2020620206
// this allows to rule out cases when both property and indexer are inherited from the base class
2020720207
let errorNode: Node;
2020820208
if (propDeclaration &&
20209-
(getSpecialPropertyAssignmentKind(propDeclaration as BinaryExpression) === SpecialPropertyAssignmentKind.ThisProperty ||
20209+
(propDeclaration.kind === SyntaxKind.BinaryExpression ||
2021020210
propDeclaration.name.kind === SyntaxKind.ComputedPropertyName ||
2021120211
prop.parent === containingType.symbol)) {
2021220212
errorNode = propDeclaration;

0 commit comments

Comments
 (0)