Xo is experimental. The source code is not public yet; it will be soon. Read the release notes
Menu · XO1312

Docs

XO1312: import forbidden by a deny rule

error · reported by the checker

A deny <package> -> <package>, ... line of xo.mod is an import direction rule: a package matching the left side may not use a package matching any pattern on the right. A pattern is a package path, or a path ending in /... that matches it and every package under it. Each direct use is checked, whether or not it is used, so a chain of imports is caught at its first forbidden step. The rules of the main module (and of each workspace module) apply to its own packages. There is no machine fix: removing an import is a design change. Move the code the package needs to a package it may import (often an interface or a plain data type in the lower layer), or change the rule if the architecture changed. xo query imports <pkg> lists the imports of a package with the use line of each. See core 4.2 and decision 0095.

Example

// xo.mod: deny example.com/notes/domain -> example.com/notes/store
// domain/note.xo:
use example.com/notes/store

Fix

// domain declares what it needs; store implements it
// domain/note.xo:
pub interface NoteStore {
  fn get(self, id: Int) -> Note ! NotFound
}

Run xo explain XO1312 for this text in a terminal, or see section 10.6 of the specification.