Markdown for LLMs
LDC-E1102 — A package cannot import itself
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-E1102 — A package cannot import itself ## What it means 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. ## Example ```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; ``` ## Fix ```law language "law.core" version "0.2"; package demo.diagnostics version "0.1.0"; namespace "urn:law:demo:diagnostics"; entity Applicant; ``` ## Engine message The engine reports this in its own wording: ```text example.law:4:1: error LDC-E1102: package "demo.diagnostics" imports itself (§23: imports acyclic) ``` ## Related - [LDC-E1103](/diagnostics/LDC-E1103/) — the same import declared twice is rejected too. - [Vocabulary](/constructs/vocabulary/) — how names are declared and which positions take them.