<?php /** * @template T * @template R * @param callable(T):R $callable * @return array{first:T,last:R} */ function generic($callable) { } $b = generic( /** * @param string $a * @return (string|int)[] */ function ($a) { return []; } ); $c = $b['first']; // not resolve $d = $b['last']; // work correctly
ciricode thank you for the test case;
Right, we don't substitute callable type arguments - yet.
Will be implemented.
Implemented, this feature will be available in the next update/pre-release.
Thanks for the suggestion!