mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
bugfix: prevent infinite-loop when resolving type-aliases
The type-expander returns the same `intersection_type` in case something is not properly expandable. To avoid infinite-loop, we do explicitly verify that the expanded alias is actually resolved Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
parent
77436b1339
commit
d9ebab6b75
@ -1629,9 +1629,7 @@ class TypeParser
|
||||
continue;
|
||||
}
|
||||
|
||||
$modified = true;
|
||||
|
||||
$normalized_intersection_types[] = TypeExpander::expandAtomic(
|
||||
$expanded_intersection_type = TypeExpander::expandAtomic(
|
||||
$codebase,
|
||||
$intersection_type,
|
||||
null,
|
||||
@ -1644,6 +1642,9 @@ class TypeParser
|
||||
true,
|
||||
true,
|
||||
);
|
||||
|
||||
$modified = $expanded_intersection_type[0] !== $intersection_type;
|
||||
$normalized_intersection_types[] = $expanded_intersection_type;
|
||||
}
|
||||
|
||||
if ($modified === false) {
|
||||
|
Loading…
Reference in New Issue
Block a user