File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1091,6 +1091,7 @@ public function dataFileAsserts(): iterable
1091
1091
yield from $ this ->gatherAssertTypes (__DIR__ . '/../Rules/Comparison/data/bug-8169.php ' );
1092
1092
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-7519.php ' );
1093
1093
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-8087.php ' );
1094
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-5785.php ' );
1094
1095
}
1095
1096
1096
1097
/**
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace Bug5785 ;
4
+
5
+ use function PHPStan \Testing \assertType ;
6
+
7
+ class HelloWorld
8
+ {
9
+ }
10
+
11
+ class IterableHelper
12
+ {
13
+ /**
14
+ * @template T
15
+ * @param iterable<T> $iterable
16
+ * @param-out iterable<T> $iterable
17
+ */
18
+ public static function act (iterable &$ iterable ): void
19
+ {
20
+ }
21
+ }
22
+
23
+ function doFoo () {
24
+ /** @var HelloWorld[] $a */
25
+ $ a = [];
26
+
27
+ assertType ('array<Bug5785\HelloWorld> ' , $ a );
28
+ IterableHelper::act ($ a );
29
+ assertType ('iterable<Bug5785\HelloWorld> ' , $ a );
30
+
31
+ }
32
+
33
+
You can’t perform that action at this time.
0 commit comments