---
title: "U3018: `of` clause that names a parameter not of function type"
url: https://una-lang.org/en/docs/errors/U3018/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U3018.md
---

# U3018: `of` clause that names a parameter not of function type

`uses of p` and `fails of p` give a function the effects and failures of the function that parameter `p` receives, so `p` MUST have a function type (ADR 0062). Naming a parameter of another type, such as a list or a number, is U3018. Name the parameter of function type instead.

## The repair at a glance

`src/demo.una`

```diff
  module demo

  pub apply_all(xs: List[Int], each: fn(Int) -> Unit) -> Unit
-   uses of xs
+   uses of each
  =
    for x in xs
      each(x)
```

## Failing example

`una.toml`

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

`src/demo.una`

```una
module demo

pub apply_all(xs: List[Int], each: fn(Int) -> Unit) -> Unit
  uses of xs
=
  for x in xs
    each(x)
```

## Fixed example

`una.toml`

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

`src/demo.una`

```una
module demo

pub apply_all(xs: List[Int], each: fn(Int) -> Unit) -> Unit
  uses of each
=
  for x in xs
    each(x)
```
