✓
Passing This code compiles and runs correctly.
Code
// `! each` arms are parallel handlers — every matching arm fires. `! else`
// opts the contiguous each/else run into exclusive dispatch: it fires only
// when no earlier arm in the run did, `! else when ...` is else-if, and a
// bare `! else` is the residual. The run is the grammar's if/else-if/else
// chain spelled on the `!` axis; the parallel default is untouched — two
// unguarded `! each` arms still both fire.
import std/io
for(1..16)
! each i when i % 15 == 0 |> std/io:print.ln("fizzbuzz")
! else i when i % 3 == 0 |> std/io:print.ln("fizz")
! else i when i % 5 == 0 |> std/io:print.ln("buzz")
! else i |> std/io:print.ln("{{ i:d }}")
for(1..4)
! each i |> std/io:print.ln("p{{ i:d }}")
! each i |> std/io:print.ln("q{{ i:d }}")
Actual
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizzbuzz
p1
q1
p2
q2
p3
q3
Expected output
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizzbuzz
p1
q1
p2
q2
p3
q3
Flows
flow ~for click a branch to expand · @labels scroll to their anchor
for (1..16)
flow ~for click a branch to expand · @labels scroll to their anchor
for (1..4)
Test Configuration
MUST_RUN