Skip to content

Commit cc7ed95

Browse files
authored
Merge pull request #10156 from boesing/bugfix/prevent-infinite-loop-in-type-parser
2 parents 3814fbb + 3fa5710 commit cc7ed95

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Psalm/Internal/Type/TypeParser.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,9 +1629,7 @@ private static function resolveTypeAliases(Codebase $codebase, array $intersecti
16291629
continue;
16301630
}
16311631

1632-
$modified = true;
1633-
1634-
$normalized_intersection_types[] = TypeExpander::expandAtomic(
1632+
$expanded_intersection_type = TypeExpander::expandAtomic(
16351633
$codebase,
16361634
$intersection_type,
16371635
null,
@@ -1644,6 +1642,9 @@ private static function resolveTypeAliases(Codebase $codebase, array $intersecti
16441642
true,
16451643
true,
16461644
);
1645+
1646+
$modified = $modified || $expanded_intersection_type[0] !== $intersection_type;
1647+
$normalized_intersection_types[] = $expanded_intersection_type;
16471648
}
16481649

16491650
if ($modified === false) {

0 commit comments

Comments
 (0)