-
Notifications
You must be signed in to change notification settings - Fork 660
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
1> Range arithmetics and assertions #6241
Conversation
I'm planning to cut a new release this weekend. Do you reckon I'll need to revert #6210 ? |
Yes, please do. I tried to work on this since then and I have obstacles everywhere. Better do it now... |
7342fe0
to
64979f3
Compare
I put aside loop features for now, they're pretty complex and they're not required for now. I also put aside the TPositiveInt deprecation, this PR should have less impact now because I kept TPositiveInt first for now when applicable. This PR should be ok, except for a test here:
I don't understand why null should be preserved through the conditional given it's always false: https://3v4l.org/K2Ed1 The next step will be to remove TPositiveInt from assertions while still keeping everythink working. |
Note: please merge #6306 before this. |
That doesn't make sense for me either, not with |
@weirdan can we maybe do a new release and merge this after? |
@orklah sure, will do this weekend. |
7259b1e
to
3415888
Compare
the CI is currently failing on phpunit. this is due to a particular construction like this:
Before this PR, Psalm was infering However, in Psalm The issue in phpunit can be fixed by adding phpdoc to $i that it's a positive-int, this way Psalm will infer the modulo result as I think we can merge this now |
I tried to document as much as I could directly in the code, but I'll make a summary here of what the reason for each modified file is for review and future reference purposes:
|
… relying on statements from PHPParser for assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @orklah, feel free to merge.
Congrats on your first merge! 🎆 |
Thanks! 🥳 |
This PR is the continuation of #6210. It should fix some issues introduced in it due to assertions.
However, I underestimated this task. There are a few points I don't know how to fix and I'll probably need help for that.
If we need to make a new release, I think #6210 should be reverted to prevent creating false positives in builds. I'll reintegrate in this PR later
EDIT:
this fixes #5635
this fixes #4972
this fixes #6488
this fixes #6467