✓
Passing This code compiles and runs correctly.
Code
// An effect's resume is EITHER a single anonymous `-> T` OR a named sum of
// arms — never both. The arms ARE the resume; a `-> T` alongside them has
// nothing left to type. Sibling of the accept pins 210_092/093.
~pub event request { payload: i32 }
! ask i32 -> i32
| halved i32
| timeout
| done i32
~proc request|zig {
const r = ask(payload);
return .{ .done = r };
}
Frontend must reject with:
CONTAINS cannot declare both a '-> T' resume and named resume armsError Verification
Actual Compiler Output
error[PARSE003]: effect branch cannot declare both a '-> T' resume and named resume arms - the arms are the resume
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_135_effect_arms_exclusive_with_resume_type/input.kz:7:1
|
7 | | timeout
| ^Test Configuration
MUST_FAIL