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

Support for final constants #7668

Closed
Tracked by #6395
weirdan opened this issue Feb 14, 2022 · 2 comments · Fixed by #7666
Closed
Tracked by #6395

Support for final constants #7668

weirdan opened this issue Feb 14, 2022 · 2 comments · Fixed by #7666
Milestone

Comments

@weirdan
Copy link
Collaborator

weirdan commented Feb 14, 2022

https://psalm.dev/r/867638ab8b?php=8.1

@psalm-github-bot
Copy link

psalm-github-bot bot commented Feb 14, 2022

I found these snippets:

https://psalm.dev/r/867638ab8b
<?php

class A
{
    final const BAR = 'BAZ';
}

class B extends A {
    const BAR = 'BUZZ';
}
Psalm output (using commit 5aa06ae):

INFO: LessSpecificClassConstantType - 9:11 - The type ''BUZZ'' for B::BAR is more general than the type ''BAZ'' inherited from A::BAR

INFO: UnusedClass - 8:7 - Class B is never used

@weirdan weirdan added this to the PHP 8.1 milestone Feb 14, 2022
@weirdan weirdan changed the title Support for final constants: https://psalm.dev/r/867638ab8b?php=8.1 Support for final constants Feb 14, 2022
@weirdan weirdan linked a pull request Feb 14, 2022 that will close this issue
@weirdan
Copy link
Collaborator Author

weirdan commented Feb 16, 2022

Fixed by #7666

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

Successfully merging a pull request may close this issue.

1 participant