### Code snippet that reproduces the problem ```php /** * @template T * @param class-string<T> $typeName * @param mixed $value * @return T */ function cast($value, string $typeName) { if (is_object($value) && get_class($value) === $typeName) { return $value; } throw new RuntimeException(); } ``` https://phpstan.org/r/78d89125-d555-48b2-82bf-1a1f2f7f31a2 ### Expected output No issues ### Actual output Function cast() should return T but returns object
Code snippet that reproduces the problem
https://phpstan.org/r/78d89125-d555-48b2-82bf-1a1f2f7f31a2
Expected output
No issues
Actual output
Function cast() should return T but returns object