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

Do not invalidate related expressions in ensureNonNullability #2004

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

rajyan
Copy link
Contributor

@rajyan rajyan commented Nov 16, 2022

fixes phpstan/phpstan#8361
As specifyExpressionType and assignExpression is separated in
#1950
I want to make it public to use them when appropriate.

In ensureShallowNonNullability, I think there are no reasons to invalidate related expressions

@rajyan rajyan marked this pull request as ready for review November 16, 2022 14:41
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@rajyan rajyan changed the title do not invalidate related expressions in ensureNonNullability Do not invalidate related expressions in ensureNonNullability Nov 16, 2022
@ondrejmirtes
Copy link
Member

Perfect, thank you!

@ondrejmirtes ondrejmirtes merged commit 615dcd2 into phpstan:1.9.x Nov 16, 2022
@herndlm
Copy link
Contributor

herndlm commented Nov 16, 2022

Btw @rajyan I'm just curious - how did you know where to fix that? Do you know MutatingScope already so well or do you also have to step-debug like I do often? Or something else?

@rajyan
Copy link
Contributor Author

rajyan commented Nov 16, 2022

@herndlm
I do step debugging too. By debugging, I found that conditionalExpression of $from was invalidated unexpectedly after coalesce and could predict the cause from that.

@rajyan rajyan deleted the fix-bug-8361 branch November 16, 2022 22:03
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.

Side effects of assertType
4 participants