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

Method expects Template of object, Template of object|Template of object given. #6210

Closed
biozshock opened this issue Dec 16, 2021 · 2 comments · Fixed by phpstan/phpstan-src#955
Labels
Milestone

Comments

@biozshock
Copy link

Bug report

I'm not even sure how to explain, sorry.
Probably it infers something from method_exists and does not print it out?

Code snippet that reproduces the problem

https://phpstan.org/r/62cf8f07-ea60-4d5e-842a-41bd454c0a84

Expected output

No errors?

@ondrejmirtes ondrejmirtes added this to the Generics milestone Dec 16, 2021
@phpstan-bot
Copy link
Contributor

@biozshock After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-18: Parameter #1 $entity of method HelloWorld<TEntityClass of object>::show() expects TEntityClass of object, TEntityClass of object|TEntityClass of object given.
+18: Parameter #1 $entity of method HelloWorld<TEntityClass of object>::show() expects TEntityClass of object, TEntityClass of object given.
Full report
Line Error
18 Parameter #1 $entity of method HelloWorld<TEntityClass of object>::show() expects TEntityClass of object, TEntityClass of object given.

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

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 Mar 3, 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