✓
Passing This code compiles and runs correctly.
Code
// A compound may name a declared terminal instead of repeating its material.
// `Health` is one registered identity, while `Player` is one compound entry
// that references it. The list surface then uses the terminal alias exactly
// as it uses a scalar: the container stores `Health`, not a second float
// concept smuggled in by spelling.
import std/io
import std/proto
import std/list
std/proto:f64(Health)
std/proto(Player) {
health: Health
}
std/list:new(Player)
| list xs |> std/list:push(xs, health: 98.6) |> std/list:len(xs): n |> std/io:print.ln("len={{ n:d }}") |> std/list:free(xs)
| err e |> std/io:print.ln("ERR {{ e:s }}")
Actual
len=1
Expected output
len=1
Flows
flow ~f64 click a branch to expand · @labels scroll to their anchor
f64 (expr: Health)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Player, source: health: Health)
flow ~new click a branch to expand · @labels scroll to their anchor
new (Player)
Test Configuration
MUST_RUN