mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Improve handling of interface-implementing edge-case
This commit is contained in:
parent
88c496121e
commit
5f5a942a32
@ -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;
|
||||
}
|
||||
|
@ -659,6 +659,33 @@ class InterfaceTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'correctClassCasing' => [
|
||||
'<?php
|
||||
interface F {
|
||||
/** @return static */
|
||||
public function m(): self;
|
||||
}
|
||||
|
||||
abstract class G implements F {}
|
||||
|
||||
class H extends G {
|
||||
public function m(): F {
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
function f1(F $f) : void {
|
||||
$f->m()->m();
|
||||
}
|
||||
|
||||
function f2(G $f) : void {
|
||||
$f->m()->m();
|
||||
}
|
||||
|
||||
function f3(H $f) : void {
|
||||
$f->m()->m();
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user