From 5f5a942a322c27ee70bd29c7aadde7261633b595 Mon Sep 17 00:00:00 2001 From: Brown Date: Thu, 2 Jan 2020 15:23:57 -0500 Subject: [PATCH] Improve handling of interface-implementing edge-case --- src/Psalm/Internal/Codebase/Methods.php | 2 +- tests/InterfaceTest.php | 27 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Codebase/Methods.php b/src/Psalm/Internal/Codebase/Methods.php index 6c694a4b6..7f283635d 100644 --- a/src/Psalm/Internal/Codebase/Methods.php +++ b/src/Psalm/Internal/Codebase/Methods.php @@ -650,7 +650,7 @@ class Methods $storage = $this->getStorage($declaring_method_id); if ($storage->return_type) { - $self_class = $appearing_fq_class_name; + $self_class = $appearing_fq_class_storage->name; return clone $storage->return_type; } diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 3c60f0c09..b5b946faa 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -659,6 +659,33 @@ class InterfaceTest extends TestCase } }', ], + 'correctClassCasing' => [ + 'm()->m(); + } + + function f2(G $f) : void { + $f->m()->m(); + } + + function f3(H $f) : void { + $f->m()->m(); + }' + ], ]; }