Skip to content

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
Development

Successfully merging this pull request may close these issues.

Bogus certainty of empty array inside delayed-use closure
2 participants