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
Tuple rest patterns (§9.7): let (h, ..tail) fails to parse; let (a, ..) reports an arity mismatch #1366
Spec §9.7 ("let destructuring") lists let (head, ..tail) = get_items() ("..rest captures remaining") under "All pattern forms are available in let/var bindings". Neither tuple-rest spelling works.
fn main:
let (a, ..) = (10, 20, 30)
let (h, ..tail) = (1, 2, 3)
print(f"{a} {h} {tail.0}")
Actual: let (h, ..tail) gives error: expected ')' / expected '=' (a parse error), and let (a, ..) = (10, 20, 30) gives error: tuple pattern arity mismatch.
Expected: prints 10 1 2, with tail: (i32, i32).
Sema has a rest path for tuple destructuring (check_tuple_destructure, sub-tuple rest binding), but it hangs off NK_TUPLE_DESTRUCTURE, which the parser no longer emits. Patterns go through NK_PAT_TUPLE → check_pattern, which has no rest handling.
Activity
Tuple rest patterns: `let (a, ..)` and `let (h, ..tail)` match, and `…
Tuple rest patterns: `let (a, ..)` and `let (h, ..tail)` match, and `…
ehartford commentedon Sep 26, 2026
Verified fixed on main 55739d4 (release binary): let (a, ..) and let (h, ..tail) print 10 1 2.