✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:47:3: error: unreachable code
Failure Output
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission)
Error: output_emitted.zig:47:3: error: unreachable code
_ = &result_0;
~~^~~~~~~~~~~
output_emitted.zig:46:1: note: control flow is diverted here
return "file exists";
^~~~~~~~~~~~~~~~~~~~
output_emitted.zig:47:6: error: use of undeclared identifier 'result_0'
_ = &result_0;
^~~~~~~~ Code
~import app/fs
~tor check-file { path: string } -> string
~check-file = app/fs:open(path)
| opened _ -> "file exists" // obligation should be auto-discharged before returning!
~check-file(path: "test.txt")
Expected output
Opening file: test.txt
Closing file (auto-discharged)
Flows
subflow ~check-file click a branch to expand · @labels scroll to their anchor
open (path)
flow ~check-file click a branch to expand · @labels scroll to their anchor
check-file (path: "test.txt")
Imported Files
const std = @import("std");
const File = struct { handle: i32 };
~pub tor open { path: string } -> *File<opened!>
~proc open|zig {
std.debug.print("Opening file: {s}\n", .{path});
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return f;
}
~pub tor close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file (auto-discharged)\n", .{});
}
Test Configuration
MUST_RUN