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
Int range not updated when in loop #8020
Labels
Comments
I found these snippets: https://psalm.dev/r/65c57ad265<?php
/** @var int<0, max> */
$int = 0;
if ($int < 1) {
throw new \Exception();
}
/** @psalm-trace $int */;
for ($i = 0; $i < 10; ++$i) {
/** @var int<0, max> */
$int = 0;
if ($int < 1) {
throw new \Exception();
}
/** @psalm-trace $int */; // Should be int<1, max>
}
|
This is kinda expected. I gave up trying to change value of int ranges inside loops for a few different reasons that are still out of my skill |
theodorejb
added a commit
to theodorejb/psalm
that referenced
this issue
Dec 18, 2022
theodorejb
added a commit
to theodorejb/psalm
that referenced
this issue
Dec 18, 2022
theodorejb
added a commit
to theodorejb/psalm
that referenced
this issue
Dec 18, 2022
theodorejb
added a commit
to theodorejb/psalm
that referenced
this issue
Dec 18, 2022
theodorejb
added a commit
to theodorejb/psalm
that referenced
this issue
Dec 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/65c57ad265
I figured this would work since the variable is redefined on each loop iteration.
The text was updated successfully, but these errors were encountered: