✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: two equalities on one field contradict — `==1` and `==2` have no
// common value, so the meet is empty and the refusal names both atoms.
// Equality cannot fold by strength the way `>N`/`<N` do; there is no
// strongest winner to keep.
//
// 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 & ==1 & ==2
}
Actual compiler output
error[KORU205]: std/refine(Server): field 'port' refines to nothing — '==2' contradicts '==1'
--> tests/regression/600_STDLIB/671_REFINE/671_023_refine_eq_contradiction_refused/input.k:14: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 & ==1 & ==2)
Test Configuration
MUST_ERROR