diff --git a/tests/CallableTest.php b/tests/CallableTest.php index 05fc088be..e23e207f3 100644 --- a/tests/CallableTest.php +++ b/tests/CallableTest.php @@ -262,6 +262,39 @@ class CallableTest extends TestCase '$result' => 'list', ], ], + 'inferTemplateOfHighOrderFunctionArgByPreviousArgInClassContext' => [ + ' + */ + public function map(callable $ab) { throw new RuntimeException("???"); } + } + + /** + * @return ArrayList + */ + function getList() { throw new RuntimeException("???"); } + + /** + * @template T + * @return Closure(T): T + */ + function id() { throw new RuntimeException("???"); } + + $result = getList()->map(id()); + ', + 'assertions' => [ + '$result' => 'ArrayList', + ], + ], 'inferPipelineWithPartiallyAppliedFunctions' => [ '