# `semantic.unused_variable`

Variable is never used.

Area 3, [Logic](../topics/logic.md); not declinable; the next step is usually the agent's.

```jadpo
type Stock = Int {
    min: 0
}

function with_delivery(per_pack: Stock, delivery: Stock) -> Stock {
    var needed: Stock = per_pack
    return Stock(per_pack + delivery)
}
```

```text
error: `needed` is never used
 --> main.jadpo:6:9
  |
6 |     var needed: Stock = per_pack
  |         ^^^^^^ never read
  reason: A value nobody reads is never bound to a name, so a reader never wonders what it was for.
  next: Use `needed`, or remove its `var` line (agent)
  rule: semantic.unused_variable
  help: https://jadpo.dev/docs/errors/semantic.unused_variable

check failed: 1 error, 1 file
```
