✓
Passing This code compiles and runs correctly.
Code
// TEST: Generic instantiation with a Koru-defined named type
//
// ~type(UserIdBox = Box<UserId>) uses a ~int defined type.
// The instantiation substitutes the nominal type.
//
// Expected: Compiles and emits struct with the nominal type
~import "$std/types"
const std = @import("std");
~int(UserId)
~struct(Box<T>) { value: T }
~type(UserIdBox = Box<UserId>)
~event test_box {}
| done {}
~proc test_box {
const uid: UserId = 999;
const box = UserIdBox{ .value = uid };
std.debug.print("UserId: {d}\n", .{box.value});
return .{ .done = .{} };
}
~test_box()
| done |> _
Actual
UserId: 999
Test Configuration
MUST_RUN
Expected Behavior:
CONTAINS UserId: 999