Skip to content

Commit 1719af0

Browse files
Add test about generic
1 parent 0ae5874 commit 1719af0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/PHPStan/Rules/PhpDoc/data/bug-12458.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
Namespace Bug12458;
3+
namespace Bug12458;
44

55
class HelloWorld
66
{
@@ -14,4 +14,16 @@ public function test(array $a): void
1414
return $a;
1515
};
1616
}
17+
18+
/**
19+
* @template T of HelloWorld
20+
* @param list<T> $a
21+
*/
22+
public function testGeneric(array $a): void
23+
{
24+
/** @var \Closure(): list<T> $c */
25+
$c = function () use ($a): array {
26+
return $a;
27+
};
28+
}
1729
}

0 commit comments

Comments
 (0)