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

Parent constructor calls don't reset field type assumptions #4351

Closed
dktapps opened this issue Jan 10, 2021 · 2 comments
Closed

Parent constructor calls don't reset field type assumptions #4351

dktapps opened this issue Jan 10, 2021 · 2 comments
Labels

Comments

@dktapps
Copy link
Contributor

dktapps commented Jan 10, 2021

Bug report

A parent constructor call should be considered the same as a void method in terms of its side effects, but it seems not to be.

Code snippet that reproduces the problem

https://phpstan.org/r/8fe57cd0-e03f-44d4-a833-cc058de14a77
Demonstration: https://3v4l.org/ZVjQ5

Expected output

An error should be reported on line 21 that doSomething() is being called on Thing|null.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@c8174d5

@github-actions
Copy link

github-actions bot commented May 2, 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 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants