Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 10, 2024
1 parent 8ffa0f2 commit f22f483
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-10685.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php // lint >= 8.1

namespace Bug10685;

use function PHPStan\Testing\assertType;

class Foo
{

/**
* @template A
* @param A $value
* @return A
*/
function identity(mixed $value): mixed
{
return $value;
}

public function doFoo(): void
{
assertType('array{1|2|3, 1|2|3, 1|2|3}', array_map(fn($i) => $i, [1, 2, 3]));
assertType('array{1, 2, 3}', array_map($this->identity(...), [1, 2, 3]));
}

}

0 comments on commit f22f483

Please sign in to comment.