✓
Passing Passing: the compiler rejects this program as expected.
Code
// PIN (GREEN since KORU095): a `-> string` bare return projecting a
// parameter's memory is refused — borrows flow down, never up.
//
// `std/string:read` was exactly this tor (`{ s } -> s.data`); it retired
// the day this check landed (610_007, ruled 2026-09-05). Consumers take the
// handle; genuine escapes copy out through `snapshot`.
~import std/string
~import std/io
~pub tor peek { s: *std/string:String<view> } -> string
~peek -> s.data
Actual compiler output
error[KORU095]: tor 'peek' returns a borrow of its parameter 's' (`s.data`) — borrows flow down, never up; a `-> string` return must own what it carries
--> tests/regression/600_STDLIB/610_STRING/610_007_reject_dangling_slice/input.kz:12:0
|
12 |
| ^
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 borrowTest Configuration
MUST_ERROR