You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep less-than comparisons before match arms out of generic parsing #500
bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
A valid less-than loop followed by a payload-variant match fails during parsing at the match arm opening brace. Reproduced on master 611cc87 before the local fix:
variant Step { Value(i64), Stop }
fun run(step: Step, limit: i64) {
var cursor: i64 = 0;
while (cursor < limit) {
match step {
Step::Value(value) => { cursor += value; }
Step::Stop => { return; }
}
}
}
fun main() { run(Step::Value(1), 3); }
wavec check repro.wave reports E2001 at Step::Value(value) => {. Changing the condition to cursor != limit avoids the parse error, so this is not an unsupported match body.
front/parser/src/expr/primary.rs::peek_generic_suffix() only looks for a later closing angle and suffix. The scan can reach a match arrow and mistake ordinary comparisons for generic struct construction. Validate prospective type arguments before committing to generic parsing, while preserving nested generic calls and struct literals.
Acceptance: the minimal regression and a stack-machine program with nested match/loop/early-return paths both parse, type-check and execute; existing generic tests remain green. A local fix and substantive shared runtime regression are being validated; no patch has been committed or pushed yet.
bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
Activity