121 instantiate with named type

? Unknown Status unknown.

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 {}

~proc test_box|zig {
    const uid: UserId = 999;
    const box = UserIdBox{ .value = uid };
    std.debug.print("UserId: {d}\n", .{box.value});
}

~test_box()
input.kz

Actual

UserId: 999

Must contain:

UserId: 999

Test Configuration

MUST_RUN