From 0ac5c32f2fb4d7b7d09fbf70406399ef2f9889aa Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Fri, 25 Oct 2019 23:39:33 +0200 Subject: [PATCH] Fix #2277 - scan psalm-assert types always --- src/Psalm/Internal/Visitor/ReflectorVisitor.php | 6 ++++++ tests/AssertAnnotationTest.php | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Psalm/Internal/Visitor/ReflectorVisitor.php b/src/Psalm/Internal/Visitor/ReflectorVisitor.php index 92963f2ba..34ecb149a 100644 --- a/src/Psalm/Internal/Visitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/Visitor/ReflectorVisitor.php @@ -2609,6 +2609,12 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse ) ); + $namespaced_type->queueClassLikesForScanning( + $this->codebase, + $this->file_storage, + $this->function_template_types + $this->class_template_types + ); + $assertion_type_parts[$i] = $prefix . $namespaced_type->getId(); } else { $assertion_type_parts[$i] = $prefix . $assertion_type_part; diff --git a/tests/AssertAnnotationTest.php b/tests/AssertAnnotationTest.php index 8bfc0a894..c6419f338 100644 --- a/tests/AssertAnnotationTest.php +++ b/tests/AssertAnnotationTest.php @@ -632,6 +632,22 @@ class AssertAnnotationTest extends TestCase return $arr; }' ], + 'scanAssertionTypes' => [ + '