From fe42e8821d6f9ae8e75be7f3e5d2189faccafc51 Mon Sep 17 00:00:00 2001 From: Ivan Sidorov Date: Mon, 11 Mar 2024 18:48:38 +0000 Subject: [PATCH] Resolve fail test #10807 Resolved problem: ``` Psalm\Tests\AssertAnnotationTest::testAssertsAllongCallStaticMethodWork Psalm\Exception\CodeException: LessSpecificReturnStatement The type 'string' is more general than the declared return type 'non-empty-string' for returnNonEmpty ``` --- .../Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php index 48c50ed0c24..c9dce4d1460 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php @@ -789,7 +789,7 @@ private static function handleNamedCall( } } - if (!$callstatic_method_exists || $class_storage->hasSealedMethods($config)) { + if ($naive_method_exists || !$callstatic_method_exists || $class_storage->hasSealedMethods($config)) { $does_method_exist = MethodAnalyzer::checkMethodExists( $codebase, $method_id,