Skip to content

Commit

Permalink
fixes return type issues of methods reported for the wrong file
Browse files Browse the repository at this point in the history
fixes return type issues of methods reported for the wrong file

Fix vimeo#8457

See vimeo#8503 which fixed this issue for functions
  • Loading branch information
kkmuffme committed Dec 29, 2022
1 parent 5bfb87c commit 9130ee2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Psalm/Internal/Codebase/Methods.php
Expand Up @@ -920,6 +920,12 @@ public function getMethodReturnTypeLocation(

$storage = $this->getStorage($method_id);

// if function exists in stubs and in analyzed code
// use the return type location of the analyzed code instead of the stubbed location
if ($storage->stubbed) {
return null;
}

if (!$storage->return_type_location) {
$overridden_method_ids = $this->getOverriddenMethodIds($method_id);

Expand Down

0 comments on commit 9130ee2

Please sign in to comment.