You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phptraitImplementorTrait {
/** @var int */private$value;
publicfunctiongetValue(): int {
return$this->value;
}
}
/** @psalm-template T */traitGuideTrait {
/** @psalm-return T */abstractpublicfunctiongetValue();
}
classTest {
useImplementorTrait;
/** @template-use GuideTrait<int> */useGuideTrait;
publicfunction__construct() {
$this->value = 123;
}
}
Psalm output (using commit eca56c0):
ERROR: ImplementedReturnTypeMismatch - 6:33 - The inherited return type 'T:GuideTrait as mixed' for GuideTrait::getValue is different to the implemented return type for ImplementorTrait::getvalue 'int'
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Nov 22, 2021
ptomulik
changed the title
is:issue is:open ImplementedReturnTypeMismatch on method implemented in non-template trait and declared abstract in a templated trait
ImplementedReturnTypeMismatch on method implemented in non-template trait and declared abstract in a templated trait
Nov 23, 2021
ptomulik
added a commit
to ptomulik/psalm
that referenced
this issue
Nov 23, 2021
https://psalm.dev/r/97a5b80220
It's not a duplicate of #6937. The #6963 does not fix this, but I think I have a fix for it.
The text was updated successfully, but these errors were encountered: