---
title: "U2024: A `together` body with a statement other than `let`, or fewer than two branches"
url: https://una-lang.org/en/docs/errors/U2024/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U2024.md
---

# U2024: A `together` body with a statement other than `let`, or fewer than two branches

The body of a `together` block holds its branches: two or more `let` statements, each run as a concurrent task, whose bindings are in scope after the block (`spec/19 §1`). Any other statement in the body, or fewer than two branches, is U2024. Put the work of a branch in a function and call it from the branch's `let`; with one branch, write a plain `let`.

## The repair at a glance

`src/demo.una`

```diff
  module demo

- pub one(a: Int) -> Int
+ pub two(a: Int, b: Int) -> Int
  =
    together
      let x = a + 1
-   x
+     let y = b + 1
+   x + y
```

## Failing example

`una.toml`

```toml
[package]
name = "demo"
version = "0.1.0"
edition = "0.2"
```

`src/demo.una`

```una
module demo

pub one(a: Int) -> Int
=
  together
    let x = a + 1
  x
```

## Fixed example

`una.toml`

```toml
[package]
name = "demo"
version = "0.1.0"
edition = "0.2"
```

`src/demo.una`

```una
module demo

pub two(a: Int, b: Int) -> Int
=
  together
    let x = a + 1
    let y = b + 1
  x + y
```
