✗
Failing This test is currently failing.
Failed: frontend
Failure Output
Showing last 10 of 13 lines
2 | const File = struct { handle: i32 };
| ^
hint: capture kinds (Expression, Source, File, EmbedFile, InvocationMeta) exist only as tor parameters; produce a runtime type instead
error[KORU118]: 'File' is call-site syntax — it produces no runtime value and cannot appear in a return or resume type
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_018_auto_discharge_escaped_obligation/input.kz:13:1
|
13 | }
| ^
hint: capture kinds (Expression, Source, File, EmbedFile, InvocationMeta) exist only as tor parameters; produce a runtime type instead Code
const std = @import("std");
const File = struct { handle: i32 };
~tor open { path: string } -> *File<opened!>
~proc open|zig {
std.debug.print("Opening file\n", .{});
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return f;
}
~tor close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file (auto-discharged)\n", .{});
}
~tor get-file { path: string } -> *File<opened!>
~get-file = open(path): f -> f
~get-file(path: "test.txt")
Expected output
Opening file
Closing file (auto-discharged)
Flows
subflow ~get-file click a branch to expand · @labels scroll to their anchor
open (path)
flow ~get-file click a branch to expand · @labels scroll to their anchor
get-file (path: "test.txt")
Test Configuration
MUST_RUN