# V1030 import_cycle

URL: /docs/errors/V1030
Markdown: /docs/errors/V1030.md

> Modules import each other in a cycle; v0 forbids import cycles (design §9).

An error from the `resolve` phase. `sakura explain V1030` prints this explanation offline.

Modules import each other in a cycle; v0 forbids import cycles (design §9). Move the shared
items into a third module.

## Wrong program [#wrong-program]

[`compiler/tests/ui/V1030_import_cycle/`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V1030_import_cycle/), which the compiler's ui suite does not run yet (needs: directory fixtures in tests/ui (a cycle needs two modules)):

`a.sakura`:

```sakura
import main/b

pub fn one() -> Int { b.two() - 1 }
```

`b.sakura`:

```sakura
import main/a

pub fn two() -> Int { a.one() + 1 }
```

## Fixed program [#fixed-program]

No fixed program is checked in for this code yet; the explanation above describes the repair.
