---
title: "U0007: Malformed literal"
url: https://una-lang.org/en/docs/errors/U0007/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U0007.md
---

# U0007: Malformed literal

U0007 reports:

- an integer literal with a leading zero, a doubled underscore, or an underscore at its start or end,
- an unescaped `}` in text,
- an unescaped `{` that no expression can follow, a quote, a backslash or a `}`, as in JSON written in text (`"{\"id\": 7}"` is `"\{\"id\": 7\}"`).

## Why Una rejects it

- An integer literal is written in decimal digits, with `_` allowed only between two digits to group them, and without leading zeros except for `0` itself (`spec/01 §6`).
- Inside a text literal, `{` starts an interpolation and `}` ends it, so a `}` outside an interpolation must be escaped as `\}`.

## How to fix it

When the intended spelling is unambiguous, the diagnostic carries a mechanical edit.

## The repair at a glance

```diff
  module demo

- pub timeout() -> Int = 030
+ pub timeout() -> Int = 30
```

## Failing example

```una
module demo

pub timeout() -> Int = 030
```

## Fixed example

```una
module demo

pub timeout() -> Int = 30
```
