Skip to content

Commit

Permalink
Revert Fix scope generalization
Browse files Browse the repository at this point in the history
This reverts commit 8db1083.
  • Loading branch information
ondrejmirtes committed Jan 13, 2022
1 parent 8db1083 commit 28923f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Analyser/MutatingScope.php
Expand Up @@ -4765,6 +4765,8 @@ private static function generalizeType(Type $a, Type $b): Type
);
}
}
} elseif (count($constantArrays['b']) > 0) {
$resultTypes[] = TypeCombinator::union(...$constantArrays['b']);
}

if (count($generalArrays['a']) > 0) {
Expand Down Expand Up @@ -4800,6 +4802,8 @@ private static function generalizeType(Type $a, Type $b): Type
TypeCombinator::union(self::generalizeType($aValueType, $bValueType)),
);
}
} elseif (count($generalArrays['b']) > 0) {
$resultTypes[] = TypeCombinator::union(...$generalArrays['b']);
}

if (count($constantIntegers['a']) > 0) {
Expand Down Expand Up @@ -4849,6 +4853,8 @@ private static function generalizeType(Type $a, Type $b): Type
}
}
}
} elseif (count($constantIntegers['b']) > 0) {
$resultTypes[] = TypeCombinator::union(...$constantIntegers['b']);
}

return TypeCombinator::union(...$resultTypes, ...$otherTypes);
Expand Down

0 comments on commit 28923f6

Please sign in to comment.