Skip to content

semver: collapse a || union containing a match-all branch to * before the prerelease rule - #33739

Open
robobun wants to merge 12 commits into
mainfrom
farm/2e7244b8/semver-any-collapse
Open

semver: collapse a || union containing a match-all branch to * before the prerelease rule#33739
robobun wants to merge 12 commits into
mainfrom
farm/2e7244b8/semver-any-collapse

ci: retrigger

e9222bf
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 8, 2026 in 33m 11s

Code review found 1 important issue

Found 1 candidates, confirmed 4. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/semver/SemverQuery.rs:1119-1132 Dangling-operator branch (bare ^/~/>=) misclassified as match-all

Annotations

Check warning on line 1132 in src/semver/SemverQuery.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Dangling-operator branch (bare ^/~/>=) misclassified as match-all

Related edge case the `emitted && !branch_has_non_any` fix above won't cover: a `||`-branch that is a **bare operator with no operand** (`^`, `~`, `>=`) *does* emit a comparator — `Version::parse("")` returns `major=None`, so `to_range` yields `Range::default()` (Caret/Tilda) or `{Gte 0.0.0}` (Gte), both of which `is_match_all()` accepts, and `MATCH_ALL_BRANCH` is set. `Bun.semver.satisfies("1.2.3-alpha.1", "1.2.3-alpha.1 || ^")` now returns `false`; pre-PR Bun and npm-loose (which drops the bar