---
title: "U1010: A module whose first path segment is a dependency's local name"
url: https://una-lang.org/en/docs/errors/U1010/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U1010.md
---

# U1010: A module whose first path segment is a dependency's local name

From edition `0.4`, a package's modules import a dependency's modules under the dependency's local name: the module `text` of the dependency `util` is `util.text` in the importing package (ADR 0122 rule 47, `spec/30`). A module of the package whose path starts with that local name could be mistaken for one of the dependency's, so it is U1010 at its header. The repair is to give the need another local name with `as`, or to rename the module.

## The repair at a glance

`ita.una`

```diff
  ita demo
    version 0.1.0
    edition 0.4

  needs
-   util from path "deps/util"
+   util as strings from path "deps/util"
      accept name
```

`src/util.una`

```diff
  module util

- import util.text (shout)
+ import strings.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"
    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/util.una`

```una
module util

import util.text (shout)

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

## Fixed example

`ita.una`

```una
ita demo
  version 0.1.0
  edition 0.4

needs
  util as strings 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/util.una`

```una
module util

import strings.text (shout)

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