113 generic struct with primitives

? Unknown Status unknown.

Code

// TEST: Generic struct instantiated with nominal primitive types
//
// Combines ~string nominal types with generic structs.
// ~struct(MaybeEmail = Box<EmailAddress>) uses a Koru-defined type.
//
// Expected: Compiles and runs with nominal type inside generic

~import "$std/types"

const std = @import("std");

~string(EmailAddress)
~struct(Box<T>) { value: T }
~type(EmailBox = Box<EmailAddress>)

~event test_email {}

~proc test_email|zig {
    const email: EmailAddress = "test@example.com";
    const box = EmailBox{ .value = email };
    std.debug.print("Email: {s}\n", .{box.value});
}

~test_email()
input.kz

Actual

Email: test@example.com

Must contain:

Email: test@example.com

Test Configuration

MUST_RUN