-
Notifications
You must be signed in to change notification settings - Fork 4
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
vec(positive_int())
throws away positive
from int
#11
Comments
this seems to be a bug in phpstan, not psl. ref: https://phpstan.org/r/dd513470-8f0b-4ac2-aeb2-f1a744361b50 |
the same code works in psalm: https://psalm.dev/r/2bd5bdfee1 |
I think it's valuable to keep this open. This isn't a PSL repo, but a PSL PHPStan extension repo. |
Even if the root cause fix belongs in PHPStan, it'd be valuable to land a regression test here. |
Oh, right! i thought this was the PSL repo 😅 |
BTW to make your example green, you need template-covariant: https://phpstan.org/r/93cf74a1-99a4-4064-89b2-49eadd6208e6 |
it shouldn't need to be covariant tho 🤔 |
\PHPStan\dumpType(vec(positive_int())->assert([]));
gives
Dumped type: list<int>
, it should giveint<1, max>
.v1
psl 2.3.1
phpstan v1.9.14
The text was updated successfully, but these errors were encountered: