1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00
This commit is contained in:
orklah 2022-11-30 23:45:55 +01:00
parent 3957eb753a
commit 2da4bf98d6

View File

@ -2290,6 +2290,27 @@ class ArrayFunctionCallTest extends TestCase
}
',
],
'mergeBetweenSealedArrayWithPossiblyUndefinedAndMixedArrayIsMixedArray' => [
'code' => '<?php
function findit(Closure $x): void
{
$closure = new ReflectionFunction($x);
$statics = [];
if (rand(0, 1)) {
$statics = ["this" => "a"];
}
$b = $statics + $closure->getStaticVariables();
/** @psalm-check-type $b = array<array-key, mixed> */
$_a = count($b);
/** @psalm-check-type $_a = int<0, max> */
}
',
],
];
}