Home / Docs / Diagnostics
U1003: Import cycle
Release v0.4.0
Modules form a graph through their imports, and that graph has no cycle: a module cannot import, directly or through other modules, a module that imports it. U1003 is reported once per cycle, at the first import of the cycle's first module in path order, and names every module of the cycle. Move the declarations that both sides need into a module that both import.
Failing example
src/a.una
module a
import b (two)
pub one() -> Int = 1
pub three() -> Int = two() + 1src/b.una
module b
import a (one)
pub two() -> Int = one() + 1Fixed example
src/a.una
module a
import b (two)
pub three() -> Int = two() + 1src/b.una
module b
import c (one)
pub two() -> Int = one() + 1src/c.una
module c
pub one() -> Int = 1