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
TypeError: Argument 1 passed to PhpParser\Node\Scalar\LNumber::__construct() must be of the type int, float given #1484
Comments
@DeepDiver1975 could you please provide code sample which produces this issue? At the first glance I do not see the reason why it may happens. |
Quite hard with the hugh codebase at hand. |
When incrementing this max int by one it is not longer an int but a float ..... funny ... |
Thanks for the code sample. So
explanation from Doctrine documentation. also some information you may find here https://www.xspdf.com/resolution/50024441.html |
@DeepDiver1975 in case you didn't mention in the issue template, we have a Playground that can be used for reproducers, here is the one for the issue you found: https://infection-php.dev/r/v1r1 Thank you! |
Output with issue
Running initial test suite...
PHPUnit version: 9.5.2
318 [============================] 7 mins
Generate mutants...
Processing source code files: 214/305PHP Fatal error: Uncaught TypeError: Argument 1 passed to PhpParser\Node\Scalar\LNumber::__construct() must be of the type int, float given, called in /home/deepdiver/Development/......../vendor/infection/infection/src/Mutator/Number/IncrementInteger.php on line 81 and defined in /home/deepdiver/Development/......../vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php:25
Stack trace:
#0 /home/deepdiver/Development/......../vendor/infection/infection/src/Mutator/Number/IncrementInteger.php(81): PhpParser\Node\Scalar\LNumber->__construct()
#1 /home/deepdiver/Development/......./vendor/infection/infection/src/Mutator/NodeMutationGenerator.php(143): Infection\Mutator\Number\IncrementInteger->mutate()
#2 /home/deepdiver/Development/......./vendor/infection/infection/src/Mutator/NodeMutationGenerator.php(112): Infection\Mutator\NodeMutationGenerator->generateForMutator()
#3 /home/deepdiver/Development/......../vendor/infection/infection/src/PhpParser/Visitor/MutationC in /home/deepdiver/Development/......../vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php on line 25
The text was updated successfully, but these errors were encountered: