✓
Passing This code compiles and runs correctly.
Code
// Test: compound phantom labels carry the result of dimensional arithmetic.
//
// `i32[meter]` divided by `i32[second]` returns `i32[meter/second]`. The
// phantom checker doesn't derive that relationship — the author declares it
// in the converter event's signature. The `/` in the label is just opaque
// characters; what makes it meaningful is that a producer event has it as
// an output and that producer's input/output declarations match physical
// units.
~import std/io
~event read-distance { trip_id: u8 }
| traveled i32<meter>
~read-distance => traveled 100
~event read-time { trip_id: u8 }
| elapsed i32<second>
~read-time => elapsed 4
~event compute-velocity { d: i32<meter>, t: i32<second> }
| result i32<meter/second>
~compute-velocity => result d / t
~read-distance(trip_id: 1)
| traveled m |> read-time(trip_id: 1)
| elapsed s |> compute-velocity(d: m, t: s)
| result v |> std/io:print.ln("{{ v:d }} m/s")
Actual
25 m/s
Expected output
25 m/s
Test Configuration
MUST_RUN