?
Unknown Status unknown.
Code
// TEST: MUST_FAIL - Nominal int types are distinct
//
// UserId and ProductId are both ints, but Koru should reject
// passing one where the other is expected.
//
// Expected: Compilation error - type mismatch
~import "$std/types"
~int(UserId)
~int(ProductId)
~event get_user { id: UserId }
| found []const u8
~proc get_user|zig {
return .{ .found = "Alice" };
}
~event main {}
~proc main|zig {
// ERROR: Passing ProductId where UserId is expected
const pid: ProductId = 42;
~get_user(id: pid)
| found |> done {}
}
~main()
Must contain:
type mismatchError Verification
Expected Error Pattern
MUST_FAILActual Compiler Output
error[KORU003]: inline flows are not supported inside `~proc` bodies: ~get_user(id: pid)
--> tests/regression/000_CORE_LANGUAGE/030_TYPES_VALUES/030_131_nominal_int_mismatch/input.kz:25:5
|
25 | ~get_user(id: pid)
| ^
hint: lift this into a top-level subflow (e.g. `~my_event = call(args) | branch x |> done {}`) or invoke the event from outside the proc bodyTest Configuration
MUST_FAIL