Values and types · rule
type.constructor_input
Value cannot be converted to this type.
Area 2, Values and types; not declinable; the next step is usually the agent's.
type OrderId = Uuid {}type ProductName = Text { max_length: 120}function order_for(name: ProductName) -> OrderId { return OrderId(name)}
error: `OrderId` can't be built from `ProductName` --> main.jadpo:8:20 |8 | return OrderId(name) | ^^^^ this is `ProductName` reason: `OrderId` is built on `Uuid` and `ProductName` is built on `Text`; a constructor converts only between types with the same representation, re-checking the rules. next: Pass a value built on `Uuid` (agent) rule: type.constructor_input help: https://jadpo.dev/docs/errors/type.constructor_inputcheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/type.constructor_input.md.Built from Jadpo main at a707efb.