Diagnostic and cause
LinkModule path collision
- Family
- topaz
- Phase
- resolve
- Code
TPZ3004
Cause and conditions
A module path is rejected with TPZ3004 when two same-kind sibling entries match the same normalized or case-folded module name.
Related rule: Trigger and repairResponse
Rename or remove one candidate, then update its imports. Keep module path spellings distinct after normalization and case folding.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 369-377 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 751-751 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 139-183 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 747-756 - TPZ3004 at
151141d7bb44
Compiler phase: resolve.
Compiler explanation: Two physical module candidates collide under exact, normalized, or folded path identity.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- the path
⟨value⟩collides with another candidate under the module name keys⟨value⟩ Source - the modules
⟨value⟩and⟨value⟩resolve to the same physical file; one physical file cannot have two module identities Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ3004]: the path
libcollides with another candidate under the module name keys: Lib.tpz / lib.tpz
More than one filesystem entry matches a module segment after Unicode normalization or case folding. Here lib.tpz and Lib.tpz collide on a filesystem that preserves both names.
Trigger and repair
A module path is rejected with TPZ3004 when two same-kind sibling entries match the same normalized or case-folded module name.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 139-183 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 747-756 - TPZ3004 at
151141d7bb44
Response
LinkRename or remove one candidate, then update its imports. Keep module path spellings distinct after normalization and case folding.
Reproduction and verification
LinkRejected program
Linkimport lib
No stdout.
export let value = 1
export let other = 2
Expected result
The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 369-377 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 751-751 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 139-183 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 747-756 - TPZ3004 at
151141d7bb44
Corrected program
Linkimport lib
export let value = 1
Expected result
Expected result
Checking accepts the program. Exit code 0.
This program applies the repair described above. The verification status records whether it has been run.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 139-183 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 747-756 - TPZ3004 at
151141d7bb44