Support int range in bitwise operations#4435
Conversation
59e7faa to
58f1d72
Compare
|
Seems like it solves phpstan/phpstan#9384 too, I need to add regression tests |
|
#4437 first would be great |
|
#4437 now merged. |
58f1d72 to
0a05389
Compare
|
This pull request has been marked as ready for review. |
18de880 to
ccafa7b
Compare
ccafa7b to
bc4994c
Compare
|
This pull request has been marked as ready for review. |
There was a problem hiding this comment.
in the future we might move the finite/constant-types logic into a new PHPStan\Type\TypeUtils method
if ($leftType instanceof IntegerRangeType) {
$leftTypes = $leftType->getFiniteTypes();
} else {
$leftTypes = $leftType->getConstantScalarTypes();
}
but this is an idea for a followup PR
|
in a followup we could add similar logic to other operator methods |
Which operator you have in mind ? For common maths, they end up in |
spaceship, mod |
Closes phpstan/phpstan#7912
Closes phpstan/phpstan#9384
Closes #2441