032 reject borrow return of param

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

Code

input.kz

Actual compiler output

error[KORU095]: tor 'borrow-back' returns a borrow of its parameter 's' (`s.data`) — borrows flow down, never up; a `-> string` return must own what it carries
  --> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_032_reject_borrow_return_of_param/input.kz:16:0
    |
 16 | 
    | ^
  hint: copy it into an owned String and return the handle (*String<view!>), or take the handle at the consumer instead of reading (610_007)

Frontend must reject with:

CONTAINS error[KORU095
CONTAINS borrows flow down, never up

Flows

flow ~borrow-back click a branch to expand · @labels scroll to their anchor
borrow-back (s: "hello")

Test Configuration

MUST_ERROR