File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public function dataFileAsserts(): iterable
86
86
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-5508.php ' );
87
87
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-10254.php ' );
88
88
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-7281.php ' );
89
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-9086.php ' );
89
90
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-2750.php ' );
90
91
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-2850.php ' );
91
92
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-2863.php ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Bug9086 ;
4
+
5
+ use ArrayObject ;
6
+ use function PHPStan \Testing \assertType ;
7
+
8
+ /**
9
+ * @template A
10
+ * @template B
11
+ *
12
+ * @param A $items
13
+ * @param callable(A): B $ab
14
+ * @return B
15
+ */
16
+ function pipe (mixed $ items , callable $ ab ): mixed
17
+ {
18
+ return $ ab ($ items );
19
+ }
20
+
21
+ /**
22
+ * @return ArrayObject<string, bool>
23
+ */
24
+ function getObject (): ArrayObject
25
+ {
26
+ return new ArrayObject ;
27
+ }
28
+
29
+ function (): void {
30
+ $ result = pipe (getObject (), function (ArrayObject $ i ) {
31
+ assertType ('ArrayObject<string, bool> ' , $ i );
32
+ return $ i ;
33
+ });
34
+
35
+ assertType ('ArrayObject<string, bool> ' , $ result );
36
+ };
You can’t perform that action at this time.
0 commit comments