✓
Passing Passing: the compiler rejects this program as expected.
Code
// std/channel — `closed` is channel state, not a message kind. A branch
// table entry named `closed` refuses so `! closed` stays the close
// transition.
import std/proto
import std/channel
std/proto(Reading) {
id: u64
}
std/channel:new(inbox, capacity: 8) { closed: Reading }
Actual compiler output
error[KORU161]: std/channel:new(inbox): `closed` is channel state, not a message kind — the `! closed` arm is the close transition; pick another word
--> tests/regression/600_STDLIB/699_CHANNEL/699_012_closed_kind_refused/input.k:11:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Reading, source: id: u64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: inbox, capacity: 8, source: closed: Reading)
Test Configuration
MUST_ERROR