Repository navigation
Description
Summary
Add missing negative coverage for tuple .await arity. The compiler already checks tuple await arity 2..12 and task element types, and positive tuple-await tests exist. This issue pins the arity diagnostics so tuple await does not silently accept invalid singletons or oversized tuples.
Spec
§14.11 says tuple .await supports tuple sizes 2 through 12. Tuple .await awaits all tasks and returns a tuple of their results.
let pair = (a(), b()).await // ok
let one = (a()).await // error/not tuple await
let too_many = (...13 tasks...).await // error
Current state
Sema checks tuple await in the NK_AWAIT branch. If the awaited inner expression is a tuple, it rejects element counts less than 2 or greater than 12 with await tuple requires between 2 and 12 tasks (src/SemaCheck.w:3178, src/SemaCheck.w:3181) and rejects non-task elements (src/SemaCheck.w:3183). MIR lowering then lowers tuple await by lowering all tasks first, awaiting each, and building a result tuple (src/MirLower.w:8443, src/MirLower.w:8457).
Positive coverage exists in test/spec/spec_ss14_async_await.w:21 and test/behavior/async_tuple_await.w:14, but arity negatives are missing.
Implementation plan
- Add
test/compile_errors/err_tuple_await_too_many.wwith 13 tasks and//! expect-error: await tuple requires between 2 and 12 tasks. - Add
test/compile_errors/err_tuple_await_non_task_element.wif not already present, with a tuple mixing a task and plain integer. - For singleton syntax, verify parser behavior first:
(task)is grouped expression, not a tuple, so.awaitshould follow ordinary single-task await. If the language has a one-element tuple spelling, add a specific negative for that spelling. - Keep positive tests for arities 2 and 12 to prove the boundary.
Test plan
Add compile-error fixtures listed above. Extend test/spec/spec_ss14_async_await.w or a new test/spec/spec_ss14_11_tuple_await_arity.w with a 12-task positive boundary if practical.
Acceptance criteria
- Tuple await arity > 12 is covered by a compile-error test.
- Non-task tuple element rejection is covered if not already.
- Boundary positive coverage includes arity 2 and ideally arity 12.
with build && with build :fixpoint && with build :testpass.
Dependencies
None.
Traceability
From the requirements campaign (docs/requirements.md, spec v7.1). Affected requirement IDs: 14.11.1.8.
Activity
ehartford commentedon Jul 3, 2026
Closing — await tuple 13-task and non-task-element rejections pinned by err_await_tuple_too_many / err_await_tuple_nontask (13f4f88); arity-2 positive already covered by async_tuple_await / spec_ss14_async_await. §14.
test: coverage-sweep batch 4 (#497 #504 #506 #524 #525 #531 #534)