✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: two sets sharing no value refine to nothing — sets meet by
// intersection, and an empty intersection is the same loud refusal an
// empty interval is. Never a union, never whichever block came last.
//
// Expected: the compile refuses with "refines to nothing" (EXPECT).
import std/proto
import std/refine
std/proto(Sample) {
mode: i64
}
std/refine(Sample) {
mode: i64 & 1 | 2
}
std/refine(Sample) {
mode: i64 & 3 | 4
}
Actual compiler output
refine input:Sample: mode: i64 & 3 | 4
error[KORU205]: std/refine(Sample): field 'mode' refines to nothing — '3 | 4' and '1 | 2' cannot both hold
--> tests/regression/600_STDLIB/671_REFINE/671_031_refine_alt_disjoint_refused/input.k:13:0Must contain:
refines to nothingFlows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Sample, source: mode: i64)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Sample, source: mode: i64 & 1 | 2)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Sample, source: mode: i64 & 3 | 4)
Test Configuration
MUST_ERROR