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

Dead catch is thrown in static methods #4805

Closed
tugmaks opened this issue Apr 5, 2021 · 4 comments
Closed

Dead catch is thrown in static methods #4805

tugmaks opened this issue Apr 5, 2021 · 4 comments

Comments

@tugmaks
Copy link

tugmaks commented Apr 5, 2021

Bug report

New dead catch feature in bleeding edge has strange behavior if analysing static methods

Code snippet that reproduces the problem

https://phpstan.org/r/9b143be6-fea0-4b50-a758-2104666a096c

Expected output

But if method is not static everything is correct
https://phpstan.org/r/7704783f-6275-4c31-b0f1-6777db44d0a0

@mabar
Copy link
Contributor

mabar commented Apr 5, 2021

Calling the method on class instead of object works as expected too
https://phpstan.org/r/e0f24a18-e041-4246-b671-cfeb8d17b39e

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@8c7cf85

@tugmaks
Copy link
Author

tugmaks commented Apr 5, 2021

Thank you!

@github-actions
Copy link

github-actions bot commented May 7, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants