mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix #2481
This commit is contained in:
parent
b83226a0db
commit
1dd062a810
@ -347,6 +347,22 @@ function array_merge_recursive(array ...$arrays)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-pure
|
||||
*
|
||||
* @no-named-arguments
|
||||
*
|
||||
* @psalm-template TKey as array-key
|
||||
* @psalm-template TValue
|
||||
*
|
||||
* @param array<TKey, TValue> ...$arrays
|
||||
*
|
||||
* @return array<TKey, TValue>
|
||||
*/
|
||||
function array_merge(array ...$arrays)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-pure
|
||||
*
|
||||
|
@ -2768,6 +2768,13 @@ class ArrayFunctionCallTest extends TestCase
|
||||
array_combine(["a", "b"], [1, 2, 3]);',
|
||||
'error_message' => 'InvalidArgument',
|
||||
],
|
||||
'arrayMergeNoNamed' => [
|
||||
'code' => '<?php
|
||||
$map = ["a" => []];
|
||||
array_merge(...$map);
|
||||
',
|
||||
'error_message' => 'NamedArgumentNotAllowed'
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user