Skip to content

Commit 9c401b4

Browse files
committed
Remove over-eager check of AccessFlags.Writing in getIndexedAccessType
1 parent 454b428 commit 9c401b4

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
@@ -10080,7 +10080,7 @@ namespace ts {
1008010080
error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
1008110081
return indexInfo.type;
1008210082
}
10083-
if (indexInfo.isReadonly && (accessFlags & AccessFlags.Writing || accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression)))) {
10083+
if (indexInfo.isReadonly && accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) {
1008410084
if (accessExpression) {
1008510085
error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
1008610086
return indexInfo.type;

0 commit comments

Comments
 (0)