✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: refine must meet a real field — a name the declaration never
// declared is a loud refusal, not a silently-new field.
//
// Expected: the compile refuses naming 'sock' (EXPECT).
import std/proto
import std/refine
std/proto(Server) {
port: i64
}
std/refine(Server) {
port: i64 & >1024
sock: i64 & >0
}
Actual compiler output
error[KORU205]: std/refine(Server): names no field 'sock' — the declaration has none to refine
--> tests/regression/600_STDLIB/671_REFINE/671_004_refine_unknown_field_refused/input.k:12:0Must contain:
names no field 'sock'Flows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Server, source: port: i64)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Server, source: port: i64 & >1024
sock: i64 & >0)
Test Configuration
MUST_ERROR