---
title: "U7012: A dependency the root may not use as written"
url: https://una-lang.org/en/docs/errors/U7012/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U7012.md
---

# U7012: A dependency the root may not use as written

A package of edition `0.4` uses a dependency only on terms its root states (ADR 0122, `spec/30`). U7012 reports, at the root's need, a dependency the root may not use as written: a package from a local path whose name a registry may hold, without `accept name` under the need, so a local package never silently takes the place of a published one; and a dependency of a later edition than the package. The repair is to accept the name, after checking that the path is the package meant, or to use an earlier version.

## The repair at a glance

`ita.una`

```diff
  ita demo
    version 0.1.0
    edition 0.4

  needs
    util from path "deps/util"
+     accept name
```

`src/demo.una`

```diff
  module demo

- pub one() -> Int = 1
+ import util.text (shout)
+
+ pub greet() -> Text = shout("hello")
```

## Failing example

`ita.una`

```una
ita demo
  version 0.1.0
  edition 0.4

needs
  util from path "deps/util"
```

`ita.lock`

```una
lock 1

solver
  encoding "una-smt-1"
  name "z3"
  version "5.1.0"
  logic "QF_UFLIA"
  steps 5000000
  seed 0

package util 0.1.0
  from path "deps/util"
  digest "sha256:0000000000000000000000000000000000000000000000000000000000000000"
```

`deps/util/ita.una`

```una
ita util
  version 0.1.0
  edition 0.4
```

`deps/util/src/text.una`

```una
module text

pub shout(word: Text) -> Text = word
```

`src/demo.una`

```una
module demo

pub one() -> Int = 1
```

## Fixed example

`ita.una`

```una
ita demo
  version 0.1.0
  edition 0.4

needs
  util from path "deps/util"
    accept name
```

`ita.lock`

```una
lock 1

solver
  encoding "una-smt-1"
  name "z3"
  version "5.1.0"
  logic "QF_UFLIA"
  steps 5000000
  seed 0

package util 0.1.0
  from path "deps/util"
  digest "sha256:0000000000000000000000000000000000000000000000000000000000000000"
```

`deps/util/ita.una`

```una
ita util
  version 0.1.0
  edition 0.4
```

`deps/util/src/text.una`

```una
module text

pub shout(word: Text) -> Text = word
```

`src/demo.una`

```una
module demo

import util.text (shout)

pub greet() -> Text = shout("hello")
```
