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
ReflectionProperty::getType() is marked as immutable internally, so a method that is overwriting (overloading?) this internal method would need the @psalm-immutable annotation. I have added that annotation, but psalm does not detect it and then complains about it missing:
...
final class Foo extends ReflectionProperty
{
/** @psalm-immutable */
public function getType(): ?ReflectionType
...
ERROR: [MissingImmutableAnnotation](https://psalm.dev/213) - 9:5 - ReflectionProperty::getType is marked @psalm-immutable, but Foo::getType is not marked @psalm-immutable
The text was updated successfully, but these errors were encountered:
Psalm output (using commit 212281d):
ERROR: MissingImmutableAnnotation - 9:5 - ReflectionProperty::getType is marked @psalm-immutable, but Foo::getType is not marked @psalm-immutable
This is a case of a slightly incorrect error message, the actually required annotation for instance methods is psalm-external-mutation-free or psalm-mutation-free: https://psalm.dev/r/2411650486
https://psalm.dev/r/94190bc824
ReflectionProperty::getType()
is marked as immutable internally, so a method that is overwriting (overloading?) this internal method would need the@psalm-immutable
annotation. I have added that annotation, but psalm does not detect it and then complains about it missing:ERROR: [MissingImmutableAnnotation](https://psalm.dev/213) - 9:5 - ReflectionProperty::getType is marked @psalm-immutable, but Foo::getType is not marked @psalm-immutable
The text was updated successfully, but these errors were encountered: