-
Notifications
You must be signed in to change notification settings - Fork 428
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
Conversation
@@ -1321,58 +1373,6 @@ private function resolveType(Expr $node): Type | |||
} | |||
} | |||
|
|||
if ($node instanceof Expr\AssignOp\Plus || $node instanceof Expr\BinaryOp\Plus) { |
There was a problem hiding this comment.
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
tests/PHPStan/Analyser/data/math.php
Outdated
@@ -109,4 +109,20 @@ public function doSit(int $i, int $j): void | |||
assertType('int', $i - $j); | |||
} | |||
|
|||
public function unionSum(): void |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Thank you! |
closes phpstan/phpstan#5584