Skip to content

Commit

Permalink
Possible fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Oct 17, 2022
1 parent 860224a commit aaa9451
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Psalm/Internal/Type/TypeCombiner.php
Expand Up @@ -1167,8 +1167,7 @@ private static function scrapeIntProperties(
}

if ($type instanceof TLiteralInt) {
$combination->ints ??= [];
if (count($combination->ints) < $literal_limit) {
if ($combination->ints !== null && count($combination->ints) < $literal_limit) {
$combination->ints[$type_key] = $type;
} else {
$combination->ints[$type_key] = $type;
Expand Down Expand Up @@ -1214,6 +1213,7 @@ private static function scrapeIntProperties(
) {
$combination->value_types['int'] = new TInt();
}
$combination->ints = null;
} elseif ($type instanceof TIntRange) {
$type = clone $type;
if ($combination->ints) {
Expand All @@ -1239,9 +1239,8 @@ private static function scrapeIntProperties(
}
} else {
$combination->value_types['int'] = $type;
$combination->ints = null;
}

$combination->ints = null;
}
}

Expand Down

0 comments on commit aaa9451

Please sign in to comment.