From abe91adbe7dbe83a1a1d0a064835daaa2fe2502d Mon Sep 17 00:00:00 2001 From: Brown Date: Thu, 30 Jul 2020 09:42:23 -0400 Subject: [PATCH] Fix #3801 - convert static to Foo&static when @method is given --- .../Call/Method/MissingMethodCallHandler.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php index 9f2296c1cc0..d62531d00ce 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php @@ -188,6 +188,17 @@ public static function handleMissingOrMagicMethod( ) ?: Type::getMixed(); } + $return_type_candidate = \Psalm\Internal\Type\TypeExpander::expandUnion( + $codebase, + $return_type_candidate, + $fq_class_name, + $fq_class_name, + $class_storage->parent_class, + true, + false, + $class_storage->final + ); + if (!$result->return_type) { $result->return_type = $return_type_candidate; } else {