Skip to content

Commit f22f483

Browse files
committedSep 10, 2024··
Regression test
1 parent 8ffa0f2 commit f22f483

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

Diff for: ‎tests/PHPStan/Analyser/nsrt/bug-10685.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php // lint >= 8.1
2+
3+
namespace Bug10685;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class Foo
8+
{
9+
10+
/**
11+
* @template A
12+
* @param A $value
13+
* @return A
14+
*/
15+
function identity(mixed $value): mixed
16+
{
17+
return $value;
18+
}
19+
20+
public function doFoo(): void
21+
{
22+
assertType('array{1|2|3, 1|2|3, 1|2|3}', array_map(fn($i) => $i, [1, 2, 3]));
23+
assertType('array{1, 2, 3}', array_map($this->identity(...), [1, 2, 3]));
24+
}
25+
26+
}

0 commit comments

Comments
 (0)
Please sign in to comment.