Remove over-eager check of AccessFlags.Writing in getIndexedAccessType
This commit is contained in:
parent
454b4280b1
commit
9c401b4dbb
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue