Skip to content

Commit

Permalink
Merge pull request #10156 from boesing/bugfix/prevent-infinite-loop-i…
Browse files Browse the repository at this point in the history
…n-type-parser
  • Loading branch information
weirdan committed Aug 28, 2023
2 parents 3814fbb + 3fa5710 commit cc7ed95
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Psalm/Internal/Type/TypeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1629,9 +1629,7 @@ private static function resolveTypeAliases(Codebase $codebase, array $intersecti
continue;
}

$modified = true;

$normalized_intersection_types[] = TypeExpander::expandAtomic(
$expanded_intersection_type = TypeExpander::expandAtomic(
$codebase,
$intersection_type,
null,
Expand All @@ -1644,6 +1642,9 @@ private static function resolveTypeAliases(Codebase $codebase, array $intersecti
true,
true,
);

$modified = $modified || $expanded_intersection_type[0] !== $intersection_type;
$normalized_intersection_types[] = $expanded_intersection_type;
}

if ($modified === false) {
Expand Down

0 comments on commit cc7ed95

Please sign in to comment.