mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix #4005 - prevent crash when assignment var assertion no longer valid
This commit is contained in:
parent
12798d1cab
commit
de6b354fa0
@ -125,6 +125,15 @@ class ForTest extends \Psalm\Tests\TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'noException' => [
|
||||
'<?php
|
||||
/**
|
||||
* @param list<int> $arr
|
||||
*/
|
||||
function cartesianProduct(array $arr) : void {
|
||||
for ($i = 20; $arr[$i] === 5 && $i > 0; $i--) {}
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user