Skip to content

Commit aaa5592

Browse files
committed
Permit assignment this.xxx when class has index signature
1 parent 7dc1f40 commit aaa5592

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
@@ -20192,7 +20192,7 @@ namespace ts {
2019220192
markAliasReferenced(parentSymbol, node);
2019320193
}
2019420194
if (!prop) {
20195-
const indexInfo = assignmentKind === AssignmentKind.None || !isGenericObjectType(leftType) ? getIndexInfoOfType(apparentType, IndexKind.String) : undefined;
20195+
const indexInfo = assignmentKind === AssignmentKind.None || !isGenericObjectType(leftType) || isThisTypeParameter(leftType) ? getIndexInfoOfType(apparentType, IndexKind.String) : undefined;
2019620196
if (!(indexInfo && indexInfo.type)) {
2019720197
if (isJSLiteralType(leftType)) {
2019820198
return anyType;

0 commit comments

Comments
 (0)