Skip to content

Commit

Permalink
Remove over-eager check of AccessFlags.Writing in getIndexedAccessType
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Apr 28, 2019
1 parent 454b428 commit 9c401b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Expand Up @@ -10080,7 +10080,7 @@ namespace ts {
error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
return indexInfo.type;
}
if (indexInfo.isReadonly && (accessFlags & AccessFlags.Writing || accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression)))) {
if (indexInfo.isReadonly && accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) {
if (accessExpression) {
error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
return indexInfo.type;
Expand Down

0 comments on commit 9c401b4

Please sign in to comment.