mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Add failing test
This commit is contained in:
parent
3caceb7131
commit
3eea15e840
28
tests/ReturnTypeProvider/ArraySliceTest.php
Normal file
28
tests/ReturnTypeProvider/ArraySliceTest.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Psalm\Tests\ReturnTypeProvider;
|
||||
|
||||
use Psalm\Tests\TestCase;
|
||||
use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait;
|
||||
|
||||
class ArraySliceTest extends TestCase
|
||||
{
|
||||
use ValidCodeAnalysisTestTrait;
|
||||
|
||||
public function providerValidCodeParse(): iterable
|
||||
{
|
||||
yield 'arraySliceWithTemplatedArrayParameter' => [
|
||||
'<?php
|
||||
/**
|
||||
* @template T as string[]
|
||||
* @param T $a
|
||||
* @return string[]
|
||||
*/
|
||||
function f(array $a): array
|
||||
{
|
||||
return array_slice($a, 1);
|
||||
}
|
||||
',
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user