Markdown for LLMs
LDC-W1115 — A declaration shadowing a prelude type
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-W1115 — A declaration shadowing a prelude type ## What it means The prelude ships a small set of well-known types that every package can name without declaring. Declaring a local entity under one of those names does not break anything — the bare name then resolves to the local declaration, and the prelude type stays reachable by its qualified path — but every reader of the package must now remember which of the two a bare occurrence means. The warning asks whether the shadowing is deliberate. If it is, keep the name and qualify prelude uses. If it is an accident of naming, rename the local declaration and the warning goes with it. ## Example ```law language "law.core" version "0.2"; package demo.diagnostics version "0.1.0"; namespace "urn:law:demo:diagnostics"; entity Actor; ``` ## Fix ```law language "law.core" version "0.2"; package demo.diagnostics version "0.1.0"; namespace "urn:law:demo:diagnostics"; entity Performer; ``` ## Engine message The engine reports this in its own wording: ```text example.law:5:8: warning LDC-W1115: declaration "Actor" shadows prelude type `law.std.actors::Actor`: a bare name in this package resolves to the declaration, std is taken by qualification `law.std.actors::Actor` (§35/§266, errata E-0155) ``` ## Related - [Vocabulary](/constructs/vocabulary/) — how names are declared and resolved.