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

    TPZ3009: Name is not exported

    Selecting a private or absent module member produces TPZ3009 even when the module exports no declarations.

    Diagnostic and cause

    Link

    Name is not exported

    Family
    topaz
    Phase
    resolve
    Code
    TPZ3009

    Cause and conditions

    Selecting a private or absent name through an import selection or namespace member produces TPZ3009. An empty export table follows the same rule.

    Response

    Select an exported name, or add export to the declaration when it belongs in the public API.

    Source evidence

    The compiler facts describe the earlier module implementation. The uniform module contract permits empty export tables and rejects unavailable selections with TPZ3009.

    Compiler phase: resolve.

    Compiler explanation: A selected import or namespace member names something the module does not export.

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

    • ⟨value⟩ is not exported by ⟨value⟩⟨value⟩ Source
    • ⟨value⟩ is not exported by ⟨value⟩⟨value⟩ Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ3009]: hidden is not exported by lib

    The selected import or namespace member is absent from the target module's exported declarations. A matching private declaration does not make the name available to importers. The same condition applies when the export table is empty.

    Rulediagnostics.tpz3009.rule

    Trigger and repair

    Selecting a private or absent name through an import selection or namespace member produces TPZ3009. An empty export table follows the same rule.

    Source evidence

    Response

    Link

    Select an exported name, or add export to the declaration when it belongs in the public API.

    Reproduction and verification

    Link

    Rejected program

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

    Expected result

    Rejection during resolve. Nonzero exit.

    • TPZ3009 diagnostic-tpz3009 at example.tpz:1:14

    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 { hidden }
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    lib.tpzCorrected programOpen in Playground
    1. export let hidden = 1
    2. export let visible = 2
    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