1
0
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:
Brown 2020-08-17 15:47:39 -04:00
parent 12798d1cab
commit de6b354fa0

View File

@ -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--) {}
}'
],
];
}