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 false-positive when merging unions with + #657

Merged
merged 4 commits into from
Sep 3, 2021

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 3, 2021

@@ -1321,58 +1373,6 @@ private function resolveType(Expr $node): Type
}
}

if ($node instanceof Expr\AssignOp\Plus || $node instanceof Expr\BinaryOp\Plus) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just moved this block before the integer-range math

@staabm staabm marked this pull request as ready for review September 3, 2021 07:19
@@ -109,4 +109,20 @@ public function doSit(int $i, int $j): void
assertType('int', $i - $j);
}

public function unionSum(): void
Copy link
Member

Choose a reason for hiding this comment

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

When solving a specific issue, please always create a new file called bug-xxxx.php, thanks. The namespace in the file should also match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ondrejmirtes ondrejmirtes merged commit ddd520f into phpstan:master Sep 3, 2021
@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
2 participants