mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
add test
This commit is contained in:
parent
3957eb753a
commit
2da4bf98d6
@ -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> */
|
||||
}
|
||||
',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user