✓
Passing Passing: the compiler rejects this program as expected.
Code
// std/channel — a join arm names a kind in the channel's vocabulary or
// `closed`; anything else refuses naming the vocabulary.
import std/io
import std/proto
import std/channel
std/proto(Reading) {
id: u64
}
std/channel:new(inbox, capacity: 8) { reading: Reading }
std/channel(inbox)
! nosuch v |> std/io:print.ln("{{ v.id:d }}")
Actual compiler output
error[KORU161]: std/channel:new(inbox): join arm `! nosuch` names no kind — inbox carries reading (and `closed`)
--> tests/regression/600_STDLIB/699_CHANNEL/699_016_unknown_kind_arm_refused/input.k:13: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: reading: Reading)
flow ~std/channel click a branch to expand · @labels scroll to their anchor
std/channel (inbox)
Test Configuration
MUST_ERROR