diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index faae088d7..bfdcc9934 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -716,7 +716,8 @@ class ClassLikes public function getUnAliasedName(string $alias_name) { $alias_name_lc = strtolower($alias_name); - if (isset($this->existing_classlikes_lc[$alias_name_lc])) { + + if ($this->existing_classlikes_lc[$alias_name_lc] ?? false) { return $alias_name; } diff --git a/tests/ClassTest.php b/tests/ClassTest.php index f7f4be909..ec57d7956 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -429,6 +429,20 @@ class ClassTest extends TestCase [], ['PropertyNotSetInConstructor'], ], + 'classAliasNoException' => [ + '