From 7128f0d7d3e2b1910e5a7635bc5d43e329bf9afb Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Sun, 24 Mar 2024 22:07:33 +0100 Subject: [PATCH] Fix storage not available in thread for intersection doc types --- src/Psalm/Internal/Type/TypeParser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }