Skip to content
docs
Arxo ↗

LDC-W1115 — A declaration shadowing a prelude type

For LLMs5 sections

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.

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

The engine reports this in its own wording:

Output
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)

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

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