diff --git a/src/Psalm/Internal/Visitor/ReflectorVisitor.php b/src/Psalm/Internal/Visitor/ReflectorVisitor.php index f316f911e..206d07926 100644 --- a/src/Psalm/Internal/Visitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/Visitor/ReflectorVisitor.php @@ -1064,6 +1064,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse if ($node->extends) { $parent_fqcln = ClassLikeAnalyzer::getFQCLNFromNameObject($node->extends, $this->aliases); + $parent_fqcln = $this->codebase->classlikes->getUnAliasedName($parent_fqcln); $this->codebase->scanner->queueClassLikeForScanning( $parent_fqcln, $this->file_path, @@ -1087,6 +1088,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse foreach ($node->extends as $interface) { $interface_fqcln = ClassLikeAnalyzer::getFQCLNFromNameObject($interface, $this->aliases); + $interface_fqcln = $this->codebase->classlikes->getUnAliasedName($interface_fqcln); $this->codebase->scanner->queueClassLikeForScanning($interface_fqcln, $this->file_path); $storage->parent_interfaces[strtolower($interface_fqcln)] = $interface_fqcln; $this->file_storage->required_interfaces[strtolower($interface_fqcln)] = $interface_fqcln; diff --git a/tests/ClassTest.php b/tests/ClassTest.php index 43169e0dc..5eb32c24f 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -455,7 +455,17 @@ class ClassTest extends TestCase class_alias(FeatureV1::class, Feature::class); class App { use Feature; } ' - ] + ], + 'classAliasParent' => [ + '