✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: a scoped refine meets against the universal blocks too — the
// `|fpga` facet is the meet of universal + fpga declarations, so a
// universal `>=1000` and a scoped `<=255` still meet to an empty
// interval and refuse loudly at the scoped site.
//
// Expected: the compile refuses with "refines to nothing" (EXPECT).
import std/proto
import std/refine
std/proto(Sample) {
value: i64
}
std/refine(Sample) {
value: i64 & >=1000
}
std/refine(Sample)|fpga {
value: i64 & <=255
}
Actual compiler output
refine input:Sample: value: i64 & >=1000
error[KORU205]: std/refine(Sample): field 'value' refines to nothing — '>=1000' and '<=255' cannot both hold
--> tests/regression/600_STDLIB/671_REFINE/671_021_refine_scope_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 (Sample, source: value: i64)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Sample, source: value: i64 & >=1000)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine|fpga (Sample, source: value: i64 & <=255)
Test Configuration
MUST_ERROR