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

    TPZ3016: Reserved module root

    An import addresses a root reserved by the language or standard library.

    Diagnostic and cause

    Link

    Reserved module root

    Family
    topaz
    Phase
    resolve
    Code
    TPZ3016

    Cause and conditions

    An import whose first path segment is topaz produces TPZ3016 before its module file is loaded.

    Response

    Choose a different root name for user modules and update their imports.

    Source evidence

    Compiler phase: resolve.

    Compiler explanation: An import addresses a root reserved by the language or standard library.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • the module path root topaz is reserved; user modules cannot live under it Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ3016]: the module path root topaz is reserved; user modules cannot live under it

    The import begins with the reserved module root topaz. A user source file beneath that name does not make the import valid.

    Rulediagnostics.tpz3016.rule

    Trigger and repair

    An import whose first path segment is topaz produces TPZ3016 before its module file is loaded.

    Source evidence

    Response

    Link

    Choose a different root name for user modules and update their imports.

    Reproduction and verification

    Link

    Rejected program

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

    Expected result

    Rejection during resolve. Nonzero exit.

    • TPZ3016 diagnostic-tpz3016 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 app.custom
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    app/custom.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