✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a proto field list takes each name once, same at the default door.
// A `std/proto` block binding `hp` on two lines is a declaration fault the
// door refuses — the merge dedup that unions `<:` field sets is not a license
// to bind one name twice in a single block.
import std/io
import std/proto
import std/list
std/proto(Dup) {
hp: f32
hp: f32
}
std/list:new(Dup)
| list xs |> std/io:print.ln("made")
| err e |> std/io:print.ln("ERR {{ e:s }}")
Actual compiler output
error[KORU173]: std/proto(Dup): field 'hp' is bound twice — a proto entry takes each field name once
--> tests/regression/600_STDLIB/665_PROTO/665_016_proto_field_bound_twice_default_door/input.k:9: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 (Dup, source: hp: f32
hp: f32)
flow ~new click a branch to expand · @labels scroll to their anchor
new (Dup)
Test Configuration
MUST_ERROR