Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceErrors

ErrorsStandard library · rule

type.unit_required

On this page

A plain number is given where a physical quantity, such as a length or a mass, needs its unit.

Area 19, Standard library; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

A quantity type, such as Length, holds an amount in a unit. A number alone could be any length: 90 could be centimetres, inches or metres. Mixing those up is the mistake the type exists to prevent, so a quantity is always made with its unit, and this error can never be declined.

A plain number still scales a quantity, by * and /.

What it looks like

main.jadpo:

example
type ShelfLength = Length {    max: 3metre}/// The shelf a kitchen gets unless the customer asks for another.function standard_shelf() -> ShelfLength {    return ShelfLength(90)}
jadpo checkcheck failed: 1 error, 1 file

error ShelfLength needs a unit, and 90 is a bare number

--> main.jadpo:7:24

  |7 |     return ShelfLength(90)  |                        ^^ no unit
reason
A Length is always made with its unit, so a number alone could be any length: a number without its unit is the mistake the type exists to prevent.
next
Write its unit after the number, such as 90metre, or make it with units.of(90, LengthUnit.metre) in any of LengthUnit's units (agent)
rule
type.unit_required
help
https://jadpo.dev/docs/errors/type.unit_required

(agent) at the end of the next: line means your coding agent can make the fix itself.

Two quantities of different kinds, such as a mass and a length, can't be added either. That is a different error, type.arithmetic_operand, which names the two kinds.

main.jadpo:

example
type ShelfLength = Length {}type ShelfLoad = Mass {}/// What a shelf is rated for, with its length added by mistake.function rated(shelf_span: ShelfLength, load: ShelfLoad) -> ShelfLoad {    return ShelfLoad(load + shelf_span)}
jadpo checkcheck failed: 1 error, 1 file

error ShelfLoad and ShelfLength can't be added: a Mass and a Length are different kinds

--> main.jadpo:7:22

  |7 |     return ShelfLoad(load + shelf_span)  |                      ^^^^^^^^^^^^^^^^^ different kinds
reason
+ works within one kind of quantity, in any of its units; a Mass and a Length are different kinds, so the sum means nothing.
next
Use values of one kind, or a product or quotient the table defines (agent)
rule
type.arithmetic_operand
help
https://jadpo.dev/docs/errors/type.arithmetic_operand

How to fix it

If the number is written in the code, write its unit after it:

example
    return ShelfLength(90cm)

The standard shelf is now 90 centimetres, and anyone reading the code sees the unit.

To make a quantity from a number and a unit your code holds, use units.of, such as units.of(90, LengthUnit.centimetre). It takes an Int or a Decimal and any unit of the kind.

Markdown for agents: /docs/errors/type.unit_required.md.Built from Jadpo main at aee2e8f.