semantic.unreachable_code
Code can never run.
Area 3, Logic; not declinable; the next step is usually the agent's.
type Count = Int { min: 0}type Size = Text {}function size_of(count: Count) -> Size { return "small" if (count > 10) { return "large" }}
error This code never runs
--> main.jadpo:9:5
|8 | return "small" | -------------- leaves on every path9 | if (count > 10) { | ^^^^^^^^^^^^^^^^^ never reached
- reason
- The statement before it ends in
returnorrejecton every path, so nothing after it in this block can run. - next
- Remove it, or move it before the statement that leaves (agent)
- rule
- semantic.
unreachable_ code - help
- https://jadpo.
dev/docs/errors/semantic. unreachable_ code
Markdown for agents: /docs/errors/semantic.unreachable_code.md.Built from Jadpo main at aee2e8f.