mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
add test
This commit is contained in:
parent
973da0a91a
commit
22fb4b5d19
@ -1950,6 +1950,20 @@ class ArrayFunctionCallTest extends TestCase
|
||||
'$line===' => 'array{0: int}<array-key, int>',
|
||||
],
|
||||
],
|
||||
'arrayUnshiftOnEmptyArrayMeansNonEmptyList' => [
|
||||
'<?php
|
||||
/**
|
||||
* @return non-empty-list<string>
|
||||
*/
|
||||
function foo(): array
|
||||
{
|
||||
$a = [];
|
||||
|
||||
array_unshift($a, "string");
|
||||
|
||||
return $a;
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user