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 issue 8292 #1983

Merged
merged 5 commits into from Nov 8, 2022
Merged

Fix issue 8292 #1983

merged 5 commits into from Nov 8, 2022

Conversation

rajyan
Copy link
Contributor

@rajyan rajyan commented Nov 7, 2022

fixes phpstan/phpstan#8292

All static expression types should be invalidated in anonymous/arrow functions, because the type is not reliable in delayed calls (skipped ClassConstFetch because I think it cannot change).
Also, this fixes the inconsistency between anonymous and arrow functions, which rvanvelzen mentioned in
#1929 (comment)
static expressions should be invalidate for arrows as well.

#1929 (comment)

I have a feeling that maybe we can get rid of expressionTypeIsUnchangeable if example like
#1934 (comment)
is not possible without using static expressions, but not sure enough.

@ondrejmirtes ondrejmirtes merged commit 8faf0fb into phpstan:1.9.x Nov 8, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@rajyan rajyan deleted the fix-issue-8292 branch November 9, 2022 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants