-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Complex exclusion not parsed correctly #42
Comments
@Seldaek I am still uncertain about how this should be parsed (e.g. is it a matter of order or operator precedence?). It seems like a bug to me, but want to check with you first. Outcome of the above constraint is:
|
it's parsed like that because it's collapsed |
the issue here is that the upper bound is parsed as being Can you try to add a comma between |
doesn't help unfortunately stof. |
Looks like the regex splitting the AND constraints does not play well with the |
looks ok to me...
|
well, in this case, yes. But try with |
that is for |
I suspect it has to do with attempting to collapse the contiguous range (since |
that's what i said 😉 |
I am confused. I wrote some tests, but they all work as expected.. |
Never mind. Added some more assertions. The string representation is identical. The actual count of constraints inside the multiconstraint is not. |
Due to the simple string comparison in there things do not end up as expected. Not sure what the most elegant solution would be here? |
I don't think it's an issue here tbh, the parsing looks fine, and it should work.. collapsing that range isn't wrong AFAICT, as |
The problem is that the upper bound + the exclude are merged into one constraint, while they should be a multiconstraint (or separate constraints in the multiconstraint being generated). You cannot have a single constraint that represents both the upper bound and the exclusion because a constraint only has one operator. |
Now it actually translates into |
In #42 (comment) the |
feel free to reopen the original composer/composer#5617 if you think it's a solver issue. |
@Seldaek that is proper parsing yes. But that only happens when there is not a contiguous range (the constraint used there was |
As you can see in my debug session, it initially creates two multi constraints, the first containing lower and upper bound, and the second containing lower and upper bound and the not constraint. When it merges them it ends up with only a lower and upper bound. See #42 (comment) for details. |
ref: composer/composer#5617
Given
version 1.3.1 is not excluded.
The text was updated successfully, but these errors were encountered: