---
title: "U1006: Undeclared requirement in `derived from`"
url: https://una-lang.org/en/docs/errors/U1006/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U1006.md
---

# U1006: Undeclared requirement in `derived from`

A `derived from` clause traces a function to the requirements it implements (`spec/08 §1`). Every identifier it lists must be declared by a `requirement` somewhere in the package, so that `una trace` can connect the contract to its origin. Declare the requirement, with its text, source, owner and status, or correct the identifier.

## The repair at a glance

```diff
  module demo

+ requirement EVENTS_3
+   text "An event with no remaining seats is always shown as sold out"
+   source policy "Box Office Handbook 2.1"
+   owner box_office
+   status active
+
  pub sold_out(remaining: Int) -> Bool
    derived from EVENTS_3
  =
    remaining < 1
```

## Failing example

```una
module demo

pub sold_out(remaining: Int) -> Bool
  derived from EVENTS_3
=
  remaining < 1
```

## Fixed example

```una
module demo

requirement EVENTS_3
  text "An event with no remaining seats is always shown as sold out"
  source policy "Box Office Handbook 2.1"
  owner box_office
  status active

pub sold_out(remaining: Int) -> Bool
  derived from EVENTS_3
=
  remaining < 1
```
