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

is_subclass_of is giving a wrong prediction when call on mixed or object. #6891

Closed
VincentLanglet opened this issue Mar 23, 2022 · 3 comments · Fixed by phpstan/phpstan-src#1124
Labels
Milestone

Comments

@VincentLanglet
Copy link
Contributor

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/ad0c77fa-c1a6-4893-bbaf-bb051911009a

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

Sure, it detected a bug today :)

@ondrejmirtes
Copy link
Member

Because we can't represent "subclass of HelloWorld" in the typesystem, I think that is_subclass_of extension shouldn't assume anything about the falsy context. //cc @herndlm

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Mar 24, 2022
@herndlm
Copy link
Contributor

herndlm commented Mar 24, 2022

weird error, there are a couple of other is_subclass_of bugs too. looks like someone needs to do a is_subclass_of bugfix session.. was on my list, but I couldn't motivate myself yet, will try to soon :)

@github-actions
Copy link

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 Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants