---
title: "U2011: Statement value is not `Unit`"
url: https://una-lang.org/en/docs/errors/U2011/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U2011.md
---

# U2011: Statement value is not `Unit`

A statement that is not the last line of its block runs for its effect, so its value must be `Unit` (`spec/02 §6`); a value of another type would be silently discarded. Bind the value with `let`, or remove the statement.

## The repair at a glance

```diff
  module demo

  pub twice(x: Int) -> Int
  =
-   x + x
-   x
+   let doubled = x + x
+   doubled
```

## Failing example

```una
module demo

pub twice(x: Int) -> Int
=
  x + x
  x
```

## Fixed example

```una
module demo

pub twice(x: Int) -> Int
=
  let doubled = x + x
  doubled
```
