Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Diagnostics

    TPZ3004: Module path collision

    Two physical module candidates collide under exact, normalized, or folded path identity.

    Diagnostic and cause

    Link

    Module 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.

    Response

    Rename or remove one candidate, then update its imports. Keep module path spellings distinct after normalization and case folding.

    Source evidence

    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 lib collides 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.

    Rulediagnostics.tpz3004.rule

    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

    Response

    Link

    Rename or remove one candidate, then update its imports. Keep module path spellings distinct after normalization and case folding.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. import lib
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    lib.tpzRejected programOpen in Playground
    1. export let value = 1
    Lib.tpzRejected programOpen in Playground
    1. export let other = 2
    Expected result

    Expected result

    Rejection during resolve. Nonzero exit.

    • TPZ3004 diagnostic-tpz3004 at example.tpz:1:8

    The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.

    Source evidence

    Corrected program

    Link
    example.tpzCorrected programOpen in Playground
    1. import lib
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    lib.tpzCorrected programOpen in Playground
    1. 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

    Menu

    Download