← Back to AILP Home

Fall — Explicit Fallthrough

pick has no implicit fallthrough. When you genuinely want one arm to continue into another, you ask for it explicitly with fall <label>;.

Labelling arms

Any arm may carry a label, written label: before the pattern:

func:failsafe = int32(tbb32:err) { exit 1i32; };
func:main = int32() {
    int32:x = 1;
    pick (x) {
        first:  (1) { fall second; },
        second: (2) { exit 2i32; },
        (*)         { exit 9i32; }
    }
    exit 0i32;
};

Selecting 1 enters the first arm, which immediately fall second; transfers control into the second arm body — so the program exits 2.

Rules

error: ARIA-PICK-004: 'fall' target 'third' is not a label in this pick

Fall vs. nesting

fall resolves to a label in the nearest enclosing pick. Inside a nested pick, fall refers to the inner pick's labels; it cannot jump out to an outer pick's arm.

(K test 034 covers labelled fall; the v0.37.x fall regressions are bug808–bug819.)