OxL Справочник OxL
РусскийEnglish

error module-cycle

error Стандарт: [§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 · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства