✓
Passing Passing: the compiler rejects this program as expected.
Code
// Pins: PARSE006's label hint names the parameter at the bare argument's
// position — second bare arg gets `a:`, third gets `b:` — not always the
// first parameter's name.
import std/io
tor mm-of { kind: i32, a: i32, b: i32 } -> i32
mm-of -> if (kind == 0) a else b
use = mm-of(1, 2, 3): m
|> std/io:print.ln("{{ m:d }}")
Actual compiler output
error[PARSE006]: bare argument '1' does not name a parameter of 'mm-of' — an explicit label is required
--> tests/regression/100_PARSER/100_087_parse006_hint_names_positional_param/input.k:9:0
|
9 | use = mm-of(1, 2, 3): m
| ^
hint: write it with an explicit label: 'kind: 1'
error[PARSE006]: bare argument '2' does not name a parameter of 'mm-of' — an explicit label is required
--> tests/regression/100_PARSER/100_087_parse006_hint_names_positional_param/input.k:9:0
|
9 | use = mm-of(1, 2, 3): m
| ^
hint: write it with an explicit label: 'a: 2'
error[PARSE006]: bare argument '3' does not name a parameter of 'mm-of' — an explicit label is required
--> tests/regression/100_PARSER/100_087_parse006_hint_names_positional_param/input.k:9:0
|
9 | use = mm-of(1, 2, 3): m
| ^
hint: write it with an explicit label: 'b: 3'Frontend must reject with:
CONTAINS does not name a parameter of 'mm-of'
CONTAINS 'a: 2'
CONTAINS 'b: 3'Flows
subflow ~use click a branch to expand · @labels scroll to their anchor
mm-of (1, 2, 3)
Test Configuration
MUST_ERROR