✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: the same contradiction split across two sibling blocks — block A
// says `==8080`, block B says `==9090`. The meet is one field, so the
// disagreement is empty, and it must be loud in EITHER declaration order:
// whichever block's transform fires first folds the other's text
// leniently, and a lenient contributor still carries a contradiction.
// Before the fix the second block's equality was dropped silently and the
// program compiled enforcing only the first — last-wins by declaration
// order, the exact thing `std/refine` promises never to do.
//
// Expected: the compile refuses with "refines to nothing" (EXPECT).
import std/proto
import std/refine
std/proto(Server) {
port: i64
}
std/refine(Server) {
port: i64 & ==8080
}
std/refine(Server) {
port: i64 & ==9090
}
Actual compiler output
refine input:Server: port: i64 & ==9090
error[KORU205]: std/refine(Server): field 'port' refines to nothing — '==9090' and '==8080' cannot both hold
--> tests/regression/600_STDLIB/671_REFINE/671_024_refine_eq_blocks_conflict_refused/input.k:18:0Must contain:
refines to nothingFlows
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 & ==8080)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Server, source: port: i64 & ==9090)
Test Configuration
MUST_ERROR