✓
Passing This code compiles and runs correctly.
Code
~import std/io
const std = @import("std");
const File = struct { handle: i32 };
~event open { path: []const u8 }
| opened *File<opened!>
~proc open|zig {
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return .{ .opened = f };
}
~event close { file: *File<!opened> }
~proc close|zig {
std.heap.page_allocator.destroy(file);
}
~event flush-close { file: *File<!opened> }
~proc flush-close|zig {
std.heap.page_allocator.destroy(file);
}
~open(path: "test.txt")
| opened _ |> _
Must contain:
multiple discharge optionsError Verification
Actual Compiler Output
error[KORU030]: Resource '_auto_6' <opened!> has multiple discharge options: close, flush-close. Discharge explicitly.
--> auto_discharge:20:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_028_ambiguous_without_default/backend.zig:94:13: 0x10244f18f in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_028_ambiguous_without_default/backend.zig:190:28: 0x10244fe7b in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Test Configuration
MUST_FAIL