mirror of
https://github.com/danog/psalm.git
synced 2024-12-13 01:37:23 +01:00
fix Mod
This commit is contained in:
parent
25f78b5d54
commit
0f17a2590c
@ -1326,10 +1326,10 @@ class ArithmeticOpAnalyzer
|
||||
}
|
||||
} elseif ($right_type_part->isPositive()) {
|
||||
if ($left_type_part->isPositiveOrZero()) {
|
||||
if ($left_type_part->max_bound !== null) {
|
||||
//we now that the result will be a range between 0 and $left->max - 1
|
||||
if ($right_type_part->max_bound !== null) {
|
||||
//we now that the result will be a range between 0 and $right->max - 1
|
||||
$new_result_type = new Type\Union(
|
||||
[new TIntRange(0, $left_type_part->max_bound - 1)]
|
||||
[new TIntRange(0, $right_type_part->max_bound - 1)]
|
||||
);
|
||||
} else {
|
||||
$new_result_type = new Type\Union([new TIntRange(0, null)]);
|
||||
|
Loading…
Reference in New Issue
Block a user