Daniel Neuman<p>Sitting in PhpStorm and trying to get type hinting to work for calling generic functions. <br />I assume `$result` should get the type `T` and `$x` should be parsed as `int`, but the editor gives me no hint at all.<br />Is this even supposed to work?<br />```<br />/**<br /> * @template T<br /> * <span class="h-card" translate="no"><a href="https://mastodon.social/@param" class="u-url mention">@<span>param</span></a></span> callable(): T $fun<br /> * <span class="h-card" translate="no"><a href="https://mastodon.social/@return" class="u-url mention">@<span>return</span></a></span> T<br /> */<br />function call(callable $fun) {<br /> $result = $fun();<br /> return $result;<br />}</p><p>$x = call(fn() => 1);<br />```<br /><a href="https://phpstan.org/r/76b4d50f-dd91-4e39-993a-458b26c321cf" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">phpstan.org/r/76b4d50f-dd91-4e</span><span class="invisible">39-993a-458b26c321cf</span></a><br /><a href="https://mastodon.social/tags/php" class="mention hashtag" rel="tag">#<span>php</span></a> <a href="https://mastodon.social/tags/phpStorm" class="mention hashtag" rel="tag">#<span>phpStorm</span></a> <a href="https://mastodon.social/tags/generics" class="mention hashtag" rel="tag">#<span>generics</span></a> <a href="https://mastodon.social/tags/phpDoc" class="mention hashtag" rel="tag">#<span>phpDoc</span></a></p>