?
Unknown Status unknown.
Code
// TEST: MUST_FAIL - Nominal string types are distinct
//
// EmailAddress and UserName are both strings, but Koru should reject
// passing one where the other is expected.
//
// Expected: Compilation error - type mismatch
~import "$std/types"
~string(EmailAddress)
~string(UserName)
~event send_email { to: EmailAddress }
~proc send_email|zig {
}
~event main {}
~proc main|zig {
// ERROR: Passing UserName where EmailAddress is expected
const name: UserName = "alice";
~send_email(to: name)
| sent |> done {}
}
~main()
Must contain:
type mismatchError Verification
Expected Error Pattern
MUST_FAILActual Compiler Output
error[KORU003]: inline flows are not supported inside `~proc` bodies: ~send_email(to: name)
--> tests/regression/000_CORE_LANGUAGE/030_TYPES_VALUES/030_130_nominal_string_mismatch/input.kz:23:5
|
23 | ~send_email(to: name)
| ^
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