Fixed InterRangeType multiplication/division of maximas by a negative constant#670
Fixed InterRangeType multiplication/division of maximas by a negative constant#670ondrejmirtes merged 13 commits intophpstan:masterfrom
Conversation
There was a problem hiding this comment.
Multiplication by $z leads to a integer range with no upper bound unioned with a range without a lower bound. the previous expectation was wrong.
|
Remaining failures seem unrelated - otherwise good to go |
src/Analyser/MutatingScope.php
Outdated
There was a problem hiding this comment.
This check was moved into the integerRangeMath method and therefore fixes multiplication with a negative number for the general case
|
I just added the same patch for division, which initially only was made for multiplication. we could make this even more complete by supporting multiplication/division with negative intervals, e.g. the PR as is already fixes a few glitches, therefore I would like to land it as is. build failures seem unrelated. ready to go. //cc @orklah |
|
Thank you! |
As discussed in #669 (comment) maxima need to be inverse when multiplying with a negative constant operand
refs phpstan/phpstan#5614
see https://3v4l.org/AUHH7