You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe i am missing some detail, but i think this code shouldn't report a type mismatch:
/**
* @template T of int|null
* @phpstan-param T $b
* @phpstan-return int|T
*/
function a(?int $b): ?int
{
if ($b === null) {
return $b; // phpstan reports: Function a() should return int|(T of int|null) but returns T.
}
return $b;
}