mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #4011 - prevent mixed assignment in loop
This commit is contained in:
parent
17ed440f2e
commit
134955a5f4
@ -531,7 +531,7 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
|
|||||||
|
|
||||||
$failed_reconciliation = 2;
|
$failed_reconciliation = 2;
|
||||||
|
|
||||||
return Type::getMixed();
|
return Type::getEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -451,7 +451,19 @@ class WhileTest extends \Psalm\Tests\TestCase
|
|||||||
|
|
||||||
return $elements;
|
return $elements;
|
||||||
}',
|
}',
|
||||||
]
|
],
|
||||||
|
'reconcilePositiveInt' => [
|
||||||
|
'<?php
|
||||||
|
$counter = 0;
|
||||||
|
|
||||||
|
while (rand(0, 1)) {
|
||||||
|
if ($counter > 0) {
|
||||||
|
$counter = $counter - 1;
|
||||||
|
} else {
|
||||||
|
$counter = $counter + 1;
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user