Skip to content
docs
Arxo ↗

LDC-E1102 — A package cannot import itself

For LLMs5 sections

Imports form a dependency graph between packages, and that graph must stay acyclic: a package already sees everything it declares, so naming itself as a dependency is never needed and always rejected. When the import names the very package being written, the compiler stops at the import line.

The repair is deletion: remove the self-import. Nothing it could have provided is lost, because the own declarations were visible all along.

Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
import demo.diagnostics version "0.1.0";
entity Applicant;
Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity Applicant;

The engine reports this in its own wording:

Output
example.law:4:1: error LDC-E1102: package "demo.diagnostics" imports itself (§23: imports acyclic)

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.