Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message for OverriddenPropertyAccess #9727

Closed
edsrzf opened this issue May 1, 2023 · 2 comments · Fixed by #9740
Closed

Confusing error message for OverriddenPropertyAccess #9727

edsrzf opened this issue May 1, 2023 · 2 comments · Fixed by #9740
Labels

Comments

@edsrzf
Copy link
Contributor

edsrzf commented May 1, 2023

The error message here is confusing: https://psalm.dev/r/f066e6d131

I would expect it to mention the base class A, like:

Property B::$foo has different access level than A::$foo
@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/f066e6d131
<?php

abstract class A {
    protected ?int $foo = null;
}

class B extends A {
    private ?int $foo = null;
}
Psalm output (using commit cd0bacb):

ERROR: OverriddenPropertyAccess - 8:18 - Property B::$foo has different access level than B::$foo

@orklah
Copy link
Collaborator

orklah commented May 1, 2023

Indeed, can you make the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants