013 reject function call in branch constructor

○ Planned This feature is planned but not yet implemented.

OWED: function calls in branch constructors are refused with the pinned diagnostic.

Failure Output

error[KORU100]: unused binding 'g'
  --> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_013_reject_function_call_in_branch_constructor/input.kz:27:0
    |
 27 | ~greet(name: "world"): g -> { value: helper(g.msg) }
    | ^
  hint: discard the binding using `_` if not needed

Code

input.kz

Actual compiler output

error[KORU100]: unused binding 'g'
  --> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_013_reject_function_call_in_branch_constructor/input.kz:27:0
    |
 27 | ~greet(name: "world"): g -> { value: helper(g.msg) }
    | ^
  hint: discard the binding using `_` if not needed

Must fail at frontend compile:

Parsing or type-checking must reject the program.

Expected compiler error

error[PARSE003]: branch constructor field 'value' contains a function call — branch constructors must be pure. Use tor chaining instead.
  --> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_013_reject_function_call_in_branch_constructor/input.kz:29:1
    |
 29 | 
    | ^

Flows

flow ~greet click a branch to expand · @labels scroll to their anchor
greet (name: "world")

Test Configuration

MUST_ERROR