From 4e0484f283d37ed590a3bcfce0cef5314c10c7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Wed, 18 Aug 2021 16:18:58 +0200 Subject: [PATCH] bugfix: resolve recursive aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- src/Psalm/Internal/Codebase/ClassLikes.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index affc067e4..31c325270 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -852,7 +852,12 @@ class ClassLikes return $alias_name; } - return $this->classlike_aliases[$alias_name_lc] ?? $alias_name; + $result = $this->classlike_aliases[$alias_name_lc] ?? $alias_name; + if ($result === $alias_name) { + return $result; + } + + return $this->getUnAliasedName($result); } public function consolidateAnalyzedData(Methods $methods, ?Progress $progress, bool $find_unused_code): void