✓
Passing This code compiles and runs correctly.
Code
~import std/control
~import std/build
~std/build:requires { exe.linkLibC(); }
const std = @import("std");
const Resource = struct {
id: usize,
};
const allocator = std.heap.c_allocator;
~tor create { id: usize } -> *Resource<active!>
~proc create|zig {
const r = allocator.create(Resource) catch unreachable;
r.* = Resource{ .id = id };
return r;
}
~tor use { r: *Resource<active> }
~proc use|zig {
std.debug.print("using {}\n", .{r.id});
}
~for(0..10)
! each i |> create(id: i): r |> use(r) // use it, but can't dispose - no destroy event exists!
Backend must reject with:
CONTAINS error[KORU030]
CONTAINS was not dischargedFlows
flow ~requires click a branch to expand · @labels scroll to their anchor
requires (source: exe.linkLibC();)
flow ~for click a branch to expand · @labels scroll to their anchor
for (0..10)