File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10394,11 +10394,11 @@ namespace ts {
10394
10394
}
10395
10395
10396
10396
// Check for compatible indexer types.
10397
- const allowedOptionalFlags = strictNullChecks ? 0 : TypeFlags.Null | TypeFlags.Undefined ;
10398
- if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol | allowedOptionalFlags )) {
10397
+ const allowedNullableFlags = strictNullChecks ? 0 : TypeFlags.Nullable ;
10398
+ if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol | allowedNullableFlags )) {
10399
10399
10400
10400
// Try to use a number indexer.
10401
- if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.NumberLike | allowedOptionalFlags ) || isForInVariableForNumericPropertyNames(node.argumentExpression)) {
10401
+ if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, TypeFlags.NumberLike | allowedNullableFlags ) || isForInVariableForNumericPropertyNames(node.argumentExpression)) {
10402
10402
const numberIndexInfo = getIndexInfoOfType(objectType, IndexKind.Number);
10403
10403
if (numberIndexInfo) {
10404
10404
getNodeLinks(node).resolvedIndexInfo = numberIndexInfo;
You can’t perform that action at this time.
0 commit comments