OxL Reference

error module-cycle

error Standard: [§2.1]

What it means#

Modules of a package may not depend on each other in a cycle (§2.1). Cycles inside one module are allowed because its files share a namespace; cycles between modules are not, because the build order and incremental caching rely on an acyclic module graph.

Example#

oxl
// src/orders/orders.oxl
use self.billing { charge }      // <- module-cycle (orders -> billing -> orders)
pub fn place() { charge() }

// src/billing/billing.oxl
use self.orders { place }
pub fn charge() { }

How to fix#

oxl
// src/common/common.oxl
pub fn charge() { }

// src/orders/orders.oxl
use self.common { charge }
pub fn place() { charge() }

// src/billing/billing.oxl
use self.common { charge }

Move the shared declarations into a third module that both depend on, or merge the two modules into one.

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides