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

[autofix.ci] apply automated fixes

df6eb9a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 8, 2026 in 46m 13s

Code review found 2 potential issues

Found 3 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/semver/SemverQuery.rs:983 has_real_operand first-byte check misclassifies x/X/*-prefixed garbage as ANY

Annotations

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

See this annotation in the file changed.

@claude claude / Claude Code Review

has_real_operand first-byte check misclassifies x/X/*-prefixed garbage as ANY

Same class as the `vv`/`==` sibling that 6663913e fixed, but a gap in that fix itself: `has_real_operand` checks only the first byte, so an `x`/`X`/`*`-prefixed garbage token (`"xx"`, `"x."`, `"*."`, `"xy"`, `"*a"`, `"^xy"`) passes the check, `Version::parse` yields `wildcard=Major`, and `to_range` produces `{Gte 0.0.0}` / `Range::default()` which `is_match_all()` accepts — `branch_has_non_any` stays false and `MATCH_ALL_BRANCH` is set. `Bun.semver.satisfies("1.2.3-alpha.1", "xx || 1.2.3-alpha.1