-
-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type from multiple Closures is not unioned #10283
Labels
Milestone
Comments
more complex repro: https://phpstan.org/r/910e8ba5-aca3-413f-8d61-fff88db292d8 |
@mvorisek After the latest push in 1.11.x, PHPStan now reports different result with your code snippet: @@ @@
-PHP 7.4 – 8.3 (7 errors)
+PHP 7.4 – 8.3 (5 errors)
==========
13: Strict comparison using !== between JsExpressionable and null will always evaluate to true.
@@ @@
26: Strict comparison using !== between JsExpressionable|void and null will always evaluate to true.
27: Method Cl::test2() should return JsExpressionable|null but returns JsExpressionable|void.
30: Unreachable statement - code above always terminates.
-38: Parameter #1 $fx of method Cl::test() expects (Closure(): JsExpressionable)|(Closure(): void), Closure(): null given.
-39: Parameter #1 $fx of method Cl::test2() expects Closure(): (JsExpressionable|void), Closure(): null given.
PHP 7.2 – 7.3 (6 errors)
========== Full reportPHP 7.4 – 8.3 (5 errors)
PHP 7.2 – 7.3 (6 errors)
|
Fixed: phpstan/phpstan-src#2902 |
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Currently, only the first Closure is analysed.
Code snippet that reproduces the problem
https://phpstan.org/r/06a4c6f9-99ec-4f9c-a8ca-d4a14633b153
once fixed, check https://phpstan.org/r/d77648c1-796f-41b3-abc0-a548b71ff927
Expected output
no phpstan error
The text was updated successfully, but these errors were encountered: