diff --git a/src/Psalm/Internal/Type/TypeParser.php b/src/Psalm/Internal/Type/TypeParser.php index 5a02c1fb1..877f10855 100644 --- a/src/Psalm/Internal/Type/TypeParser.php +++ b/src/Psalm/Internal/Type/TypeParser.php @@ -1685,7 +1685,9 @@ final class TypeParser $normalized_intersection_types = []; $modified = false; foreach ($intersection_types as $intersection_type) { - if (!$intersection_type instanceof TTypeAlias) { + if (!$intersection_type instanceof TTypeAlias + || !$codebase->classlike_storage_provider->has($intersection_type->declaring_fq_classlike_name) + ) { $normalized_intersection_types[] = [$intersection_type]; continue; }