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
Calls to parent::someMethod should remember type params #2621
Comments
Do you have examples when it's unsafe ? |
This is my best effort so far: https://phpstan.org/r/63f3bd8d-d5c1-4f59-9bbf-a5f91b93e442 But it's also, I think, how generics should work. |
I think this might be relevant: https://phpstan.org/r/efdfcc33-84d0-40e3-8b9f-28e2193b52d8 |
@muglug After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-37: Method AStringer::foo() should return A but returns object.
+No errors |
@eigan After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-35: Method Child::give() should return B but returns A.
+No errors |
Fixed: phpstan/phpstan-src@4acbc6c |
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. |
Expected output
Argument 1 of Stringer::takesParam expects A, string provided
Actual output
No issue - https://phpstan.org/r/c58ef371-1108-4e75-ae3b-b4f9a077ec69
The text was updated successfully, but these errors were encountered: