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

Fix resolving mixed + array #1579

Merged
merged 15 commits into from Aug 29, 2022
Merged

Fix resolving mixed + array #1579

merged 15 commits into from Aug 29, 2022

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Aug 1, 2022

rebased version of #1445 reworked to use isSuperTypeOf checks (feedback from ondrey).

#1445 seemed abandoned therefore I figured I could push it over the finishing line

Fixes phpstan/phpstan#7492

@staabm staabm marked this pull request as draft August 1, 2022 18:50
@staabm staabm force-pushed the bug7492 branch 2 times, most recently from f4b3b97 to 128256a Compare August 1, 2022 18:56
@staabm staabm marked this pull request as ready for review August 1, 2022 19:04
@staabm
Copy link
Contributor Author

staabm commented Aug 2, 2022

//cc @rvanvelzen

Copy link
Contributor Author

@staabm staabm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have put more thought into this PR and added a few more cases like int|array + int|array.
it fixed a few phpstan-src baseline errors, too.

it feels in better shape now

src/Reflection/InitializerExprTypeResolver.php Outdated Show resolved Hide resolved
@staabm
Copy link
Contributor Author

staabm commented Aug 25, 2022

@herndlm after your recent changes on the mixed type I see new/no longer reported errors after rebase.

would be great if I could get your opinion on these.

@herndlm
Copy link
Contributor

herndlm commented Aug 25, 2022

@herndlm after your recent changes on the mixed type I see new/no longer reported errors after rebase.

would be great if I could get your opinion on these.

I think I see failures related to #1641, so maybe left or right *never* types are incorrectly handled?

@staabm
Copy link
Contributor Author

staabm commented Aug 25, 2022

good catch. fixed in ea57b6e

thank you.

@staabm staabm marked this pull request as ready for review August 25, 2022 08:23
@staabm staabm force-pushed the bug7492 branch 3 times, most recently from a031f6c to e098195 Compare August 25, 2022 16:23
@staabm staabm marked this pull request as ready for review August 26, 2022 09:54
@staabm staabm marked this pull request as ready for review August 29, 2022 12:16
@ondrejmirtes ondrejmirtes merged commit 43dd007 into phpstan:1.8.x Aug 29, 2022
@ondrejmirtes
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants