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
Uncaught TypeError: PHPStan\Analyser\MutatingScope::getType() #8072
Comments
Seems to be related to I could fix it by adapting see https://github.com/nikic/PHP-Parser/blob/v4.15.1/lib/PhpParser/Node/Expr/CallLike.php#L36 for the assert and https://github.com/phpstan/phpstan-src/blob/1.8.6/src/Analyser/NodeScopeResolver.php#L3147 for the code that then calls |
I guess I can just patch this in the new visitors/code that was added recently for now to get rid of the problem that was apparently introduced there. Should be able to do this in the evening. |
Fixed: phpstan/phpstan-src@3758d9d |
Thank you for your reactivity! |
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. |
Bug report
Local PHPStan version: 1.8.6
First class callable function with Closures can make PHPStan crash.
Code snippet that reproduces the problem
Here is the smallest snippet I could write to reproduce:
https://phpstan.org/r/af6aa44b-8fff-4f75-ae92-f9f27f3d2f63
Notice the superfluous first class callable.
The PHP script executes normally and produces:
Expected output
Here is a fixed snippet:
https://phpstan.org/r/18fa015e-7218-49ae-b7a2-9e7acd51f810
The same OK result is expected for previous snippet.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me at each new release and I'm happy to discover how it catches new things in my codebase and improves quality.
The text was updated successfully, but these errors were encountered: