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
We have a generic class, which receives exception class as templated parameter and then uses it to throw. Previously it was recognized by PhpStan, but both on 0.12.26 & 0.12.27 this now fails (both on throw and on @throws phpDoc).
Invalid type TExceptionClass of RuntimeException to throw
PHPDoc tag @throws with type TExceptionClass of Exception is not subtype of Throwable
The issue is the ObjectType is "anything that implements/extends the type".
The question asks if "anything implementing Throwable" is superTypeOf the passed "T of Exception". And the correct answer (IMO) is a maybe. As somehow described in #3333, I worry that we need another type.
Bug report
We have a generic class, which receives exception class as templated parameter and then uses it to throw. Previously it was recognized by PhpStan, but both on 0.12.26 & 0.12.27 this now fails (both on throw and on
@throws
phpDoc).Code snippet that reproduces the problem
https://phpstan.org/r/a2f79f88-a35e-450d-86d1-86d750e6b21b
Expected output
No error.
The text was updated successfully, but these errors were encountered: