# `syntax.expected_declaration`

Expected a declaration.

Area 1, [Project layout and modules](../topics/project-layout-and-modules.md); not declinable; the next step is usually the agent's.

```jadpo
Count = Int
```

```text
error: `Count` doesn't start a declaration
 --> main.jadpo:1:1
  |
1 | Count = Int
  | ^^^^^ expected a declaration
  reason: A file holds declarations, such as `type`, `function`, `action`, `query` and `entity`, each starting a line.
  next: Start the declaration with `type`: `type Count = ...` (agent)
  rule: syntax.expected_declaration
  help: https://jadpo.dev/docs/errors/syntax.expected_declaration

check failed: 1 error, 1 file
```

A top-level `var` is this error too, and its `next:` points to `constant`,
because at the top of a file a fixed value is a constant (area 3,
[Constants](../topics/constants.md)):

```jadpo
type VatRate = Decimal {
    scale: 4
}

var vat_rate: VatRate = 0.2000
```

```text
error: `var` doesn't start a declaration
 --> main.jadpo:5:1
  |
5 | var vat_rate: VatRate = 0.2000
  | ^^^ expected a declaration
  reason: `var` names a value inside a body; at the top of a file a fixed value is a `constant`.
  next: Write `constant vat_rate: VatRate = 0.2000` (agent)
  rule: syntax.expected_declaration
  help: https://jadpo.dev/docs/errors/syntax.expected_declaration

check failed: 1 error, 1 file
```
