Repository navigation
Conversation
…al upper bound `2.3.4 - 4.5` is `>= 2.3.4, < 4.6.0`, not `>= 2.3.4 <= 4.5`. A partial upper bound covers the rest of that level, so the range accepts 4.5.9 and rejects 4.6.0. The documented equivalence is narrower than what the parser does, and the neighbouring note about the unspaced form makes it easy to read the upper bound as a bare version.
|
Correcting a factual error in the docs is about as low-risk as a README change gets, so this is just a nudge rather than a question. The claim is in the hyphen-range section: Worth noting for the doc wording: this is the same class of partial-boundary gap the constraint form already spells out explicitly ( No code changes and no new tests — the fix is confined to the equivalence sentence. Tests pass unchanged. |
The README states an equivalence the parser does not implement.
4.5is a partial upper bound, and a partial upper bound covers the rest of thatlevel, so the range is
>= 2.3.4, < 4.6.0. It accepts4.5.9.2.3.4 - 4.52.3.32.3.4 - 4.52.3.42.3.4 - 4.54.5.92.3.4 - 4.54.6.0This is not specific to that one example, and it is not a behaviour I would change —
a partial upper bound including the rest of its level is what npm, Cargo and
composer all do, and the parser is already consistent about it:
1.1 - 22.0.02.0.12.5.02.9.93.0.01.5.0 - 4.54.5.04.5.14.5.94.6.01.2 - 1.4.51.4.51.4.6The last row is a full upper bound and behaves as documented, which is what makes the
second row easy to misread: in the same list, one of the two bounds is exact and the
other is a level.
So this corrects the README rather than the code, and adds the rule next to the
examples so the surprising case is stated rather than left to be inferred.
I checked the other nineteen equivalences in the README (hyphen, wildcard, tilde and
caret) against the parser version by version, and this was the only one that
disagreed.
go test ./...is unchanged and green.