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
{{ message }}
Repository navigation
Generic<mixed> overridden by specific type in catch #15198
If in a try block I set a variable to an instance of a generic class where the generic type is mixed, and in the corresponding catch block I set that variable to an instance of the same generic class but with a specific generic type (e.g. int,) then afterwards PHPStan incorrectly sees that variable as always having the more specific generic type.
Activity
ondrejmirtes commentedon Sep 8, 2026
No idea why
$foo = new Foo($bar);is completely ignored if$baris mixed.phpstan-bot commentedon Sep 9, 2026
Closed via merging phpstan/phpstan-src#6398
github-actions commentedon Oct 11, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.