ErrorsProject layout and modules · rule
semantic.unknown_name
The code uses a name that nothing in the project or the standard library declares.
Area 1, Project layout and modules; not declinable; the next step is usually the agent's.
Why Jadpo refuses it
Every name in the code has to lead to a declaration: in the file, on a
use line, or among the built-ins. A name that leads nowhere is most
often a misspelling or a declaration not written yet, and Jadpo reports
it when you check rather than leave it to fail when the code runs.
What it looks like
main.jadpo:
type Pair = Object { first: Missing}
error Missing isn't declared
--> main.jadpo:2:12
|2 | first: Missing | ^^^^^^^ not declared
- reason
- Nothing in this project or the standard library is called
Missing. - next
- Declare
Missing, or use an existing name (agent) - rule
- semantic.
unknown_ name - help
- https://jadpo.
dev/docs/errors/semantic. unknown_ name
(agent) at the end of the next: line means your coding agent can make
the fix itself.
How to fix it
If the name is meant to be new, declare it. main.jadpo becomes:
type Missing = Text { max_length: 80}type Pair = Object { first: Missing}
Pair.first now holds a Missing, text of at most 80 characters.
If you meant a name that exists, write that name. Here the field
holds a built-in type, and main.jadpo becomes:
type Pair = Object { first: Text}
Pair.first now holds any text. A name declared in another file of a
project also needs its use line.
Related
Markdown for agents: /docs/errors/semantic.unknown_name.md.Built from Jadpo main at aee2e8f.