128 ampersand borrow requires mutable

✓ Passing Passing: the compiler rejects this program as expected.

Code

input.kz

Actual compiler output

error[KORU107]: '&r' borrows immutable binding 'r' into mutable parameter 'ptr' (*i32)
  --> tests/regression/500_INTEGRATION_TESTING/510_NEGATIVE_TESTS/510_128_ampersand_borrow_requires_mutable/input.kz:21:1
    |
 21 | ~get-data(): r |> mutate-and-print(ptr: &r)
    | ^
  hint: annotate 'r[mutable]' at the bind site to lend it mutably

Frontend must reject with:

CONTAINS error[KORU107]
CONTAINS borrows immutable binding 'r' into mutable parameter 'ptr'
CONTAINS 'r[mutable]'

Flows

flow ~get-data click a branch to expand · @labels scroll to their anchor
get-data

Test Configuration

MUST_ERROR