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

# U0006: Text literal inside interpolation

Interpolation embeds an expression in a text literal, as in `"seats {e.remaining}"` (`spec/01 §6`). The embedded expression must not contain another text literal, which keeps every literal on one level and easy to read and edit. Bind the inner text with `let` and interpolate the name instead.

## The repair at a glance

```diff
  module demo

- pub greeting() -> Text = "hello {trim(" world ")}"
+ pub greeting() -> Text
+ =
+   let name = trim(" world ")
+   "hello {name}"
```

## Failing example

```una
module demo

pub greeting() -> Text = "hello {trim(" world ")}"
```

## Fixed example

```una
module demo

pub greeting() -> Text
=
  let name = trim(" world ")
  "hello {name}"
```
