✓
Passing This code compiles and runs correctly.
Code
// TEST: multi-line Source body at the end of a |> chain
//
// When the LAST kernel op in an inline |> chain has a multi-line Source
// body, the parser detects the body's end and treats the following
// | computed handler as a sibling at the init level (not nested inside
// the kernel continuation).
//
// pairwise { single } |> self { multi-line } → computed is sibling
~import std/kernel
~import std/io
~std/kernel:shape(Body) {
mass: f64,
}
~std/kernel:init(Body) {
{ mass: 1.0 },
{ mass: 2.0 },
{ mass: 3.0 },
}
| kernel k |> std/kernel:pairwise { k.mass += k.other.mass * 0.1 } |> std/kernel:self {
k.mass *= 2.0
}
| computed c |> std/io:print.blk {
mass[0]={{ c[0].mass:f }} mass[1]={{ c[1].mass:f }} mass[2]={{ c[2].mass:f }}
}
Actual
mass[0]=3 mass[1]=4.6 mass[2]=6
Expected output
mass[0]=3 mass[1]=4.6 mass[2]=6
Test Configuration
MUST_RUN