✓
Passing This code compiles and runs correctly.
Code
// substring (FRONTIERS gap 4): returns a NEW owned String<view!> (a fresh copy,
// not a borrow into `s`), so the result carries its own ownership obligation and
// is freed independently. This is the first flow with TWO live String resources
// that must BOTH be discharged on one path (`free(sub) |> free(s)`) — proving the
// auto-discharge checker handles multiple explicit disposals (see 610_012 for the
// positional-resolution fix that made it work).
~import std/string
~import std/io
~std/string:from-page(text: "hello world")
| ok s |> std/string:substring(s, start: 0, end: 5)
| ok sub |> std/string:read(sub)
| slice text |> std/io:print.ln("{{ text:s }}") |> std/string:free(sub) |> std/string:free(s)
| err _ |> std/string:free(s)
| err _ |> _
Actual
hello
Expected output
hello
Test Configuration
MUST_RUN