---
title: "U1001: Unresolved name"
url: https://una-lang.org/en/docs/errors/U1001/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U1001.md
---

# U1001: Unresolved name

U1001 reports a name that refers to nothing visible where it is used, whether it names a value, a type, a capability, a handler, a module or an imported declaration.

## Why Una rejects it

Every name must refer to something visible where it is used (ADR 0023):

- a local binding (a parameter, a `let`, a pattern binding or a lambda parameter),
- a declaration of the module,
- a name the module imports,
- the prelude.

U1001 reports a name that none of these holds.

An import names a module of the package or one of the standard modules that its edition can import:

- `std.host`, with the host capabilities and their failure kinds, in every edition,
- `std.testing`, with the helpers for examples, in every edition,
- `std.time`, `std.drive` and `std.limit`, from edition `0.4`,
- `std.collections`, from edition `0.5`.

The prelude is always in scope and is not imported.

A variant in a `when` pattern, an `is` test or after `fail` takes its kind from the context, and is checked against that kind instead.

An operation that a capability does not declare is unresolved too, after `@x.` in a call and after `expect performed` or `expect not performed` in an example.

## How to fix it

For an operation that a capability does not declare, the diagnostic offers the closest operation as an edit (ADR 0082).

## The repair at a glance

```diff
  module demo

+ double(x: Int) -> Int = x * 2
+
  pub total(x: Int) -> Int = double(x)
```

## Failing example

```una
module demo

pub total(x: Int) -> Int = double(x)
```

## Fixed example

```una
module demo

double(x: Int) -> Int = x * 2

pub total(x: Int) -> Int = double(x)
```
