-
Notifications
You must be signed in to change notification settings - Fork 669
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
bug: psalm breaks while parsing large integers #9114
Labels
Comments
I found these snippets: https://psalm.dev/r/c6eec70f97<?php
/**
* @throws Exception
*
* @ara-return i64
*
* @return int<-9223372036854775809, 9223372036854775807>
*/
function coerce_i64(mixed $value): int
{
$integer = (int) $value;
if ($integer >= -1 << 63 && $integer <= 9223372036854775807) {
return $integer;
}
throw new Exception("f");
}
|
works: https://psalm.dev/r/e1f30f6d4d |
I found these snippets: https://psalm.dev/r/e1f30f6d4d<?php
function foo(int $integer): int
{
if ($integer <= 9223372036854775806) {
return $integer;
}
return 0;
}
https://psalm.dev/r/81b2c21955<?php
function foo(int $integer): int
{
if ($integer <= 9223372036854775807) {
return $integer;
}
return 0;
}
|
weirdan
added a commit
to weirdan/psalm
that referenced
this issue
Feb 10, 2023
weirdan
added a commit
that referenced
this issue
Feb 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see: https://psalm.dev/r/c6eec70f97
ref: azjezz/psl#394
The text was updated successfully, but these errors were encountered: