Skip to content

Commit e2709d8

Browse files
committed
Use correct nullable terminology
1 parent 9e962f5 commit e2709d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10394,11 +10394,11 @@ namespace ts {
1039410394
}
1039510395

1039610396
// 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)) {
1039910399

1040010400
// 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)) {
1040210402
const numberIndexInfo = getIndexInfoOfType(objectType, IndexKind.Number);
1040310403
if (numberIndexInfo) {
1040410404
getNodeLinks(node).resolvedIndexInfo = numberIndexInfo;

0 commit comments

Comments
 (0)