✓
Passing This code compiles and runs correctly.
Code
// Test: std/refine's field grammar — `name: type & bound…` lines — meets
// &-atoms per field name, order-independently, against a std/proto
// declaration, and reports the canonical constraint set at Stage C.
// `port` is refined across two lines — the meet must land one interval.
//
// Expected: Stage C prints the canonical meet (expected_comptime); the block
// self-erases to a `// refine …` marker, runtime prints `refined`.
import std/proto
import std/refine
import std/io
std/proto(Server) {
port: i64
retries: i64
host: string
}
std/refine(Server) {
port: i64 & >1024
port: i64 & <=65535
retries: i64 & >=0 & <10
host: string
}
std/io:print.ln("refined")
Actual
refined
Expected output
refined
Expected comptime output
refine input:Server: port: i64 & >1024 & <=65535, retries: i64 & >=0 & <10, host: stringFlows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Server, source: port: i64
retries: i64
host: string)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Server, source: port: i64 & >1024
port: i64 & <=65535
retries: i64 & >=0 & <10
host: string)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "refined")
Test Configuration
MUST_RUN