---
title: "U2020: A parameter convention (`edit`, `take`) not matched at the call site, or declared where none is allowed"
url: https://una-lang.org/en/docs/errors/U2020/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U2020.md
---

# U2020: A parameter convention (`edit`, `take`) not matched at the call site, or declared where none is allowed

A call does not match a parameter convention (`edit`, `take`), or a declaration has a convention where none is allowed.

## Why Una rejects it

A caller writes `edit p` exactly where the parameter is declared `edit`, and `take a` exactly where it is declared `take` (`spec/17 §3`). Each of these is U2020:

- a marker on a plain parameter;
- a missing marker;
- the other marker.

A method receiver follows the same rule, as in `edit total.add(by: 1)`. The argument of `edit` is a place, a binding or a field path of one, and the argument of `take` is a binding.

Operations and handlers cannot declare conventions, and neither can predicates: they are U2020 at the declaration.

## The repair at a glance

`src/demo.una`

```diff
  module demo

  pub kind Tally
    count: Int

  pub add(edit t: Tally, by: Int) -> Unit
  =
    t.count = t.count + by

  pub run() -> Int
  =
    let edit t = Tally(count: 0)
-   add(t, by: 2)
+   add(edit t, by: 2)
    t.count
```

## Failing example

`una.toml`

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

`src/demo.una`

```una
module demo

pub kind Tally
  count: Int

pub add(edit t: Tally, by: Int) -> Unit
=
  t.count = t.count + by

pub run() -> Int
=
  let edit t = Tally(count: 0)
  add(t, by: 2)
  t.count
```

## Fixed example

`una.toml`

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

`src/demo.una`

```una
module demo

pub kind Tally
  count: Int

pub add(edit t: Tally, by: Int) -> Unit
=
  t.count = t.count + by

pub run() -> Int
=
  let edit t = Tally(count: 0)
  add(edit t, by: 2)
  t.count
```
