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

    TPZ2011: Malformed import list

    An import selection list is empty, duplicate, or contains an invalid name.

    Diagnostic and cause

    Link

    Malformed import list

    Family
    topaz
    Phase
    parse
    Code
    TPZ2011

    Cause and conditions

    Each exported name and each resulting local binding appears at most once in a nonempty selected import list.

    Response

    Remove repeated selections. Select at least one identifier and give different exported names distinct local aliases.

    Source evidence

    Compiler phase: parse.

    Compiler explanation: An import selection list is empty, duplicate, or contains an invalid name.

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

    • an import name is an identifier; keywords cannot be selected Source
    • this exported name is already selected in this list Source
    • this local name is already bound by this list Source
    • a selection list selects at least one exported name Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ2011]: this exported name is already selected in this list

    The selection list repeats an exported name. A selected import list must be nonempty, and both exported names and local aliases must be unique. Keywords cannot be selected as names.

    Rulediagnostics.tpz2011.rule

    Trigger and repair

    Each exported name and each resulting local binding appears at most once in a nonempty selected import list.

    Source evidence

    Response

    Link

    Remove repeated selections. Select at least one identifier and give different exported names distinct local aliases.

    Reproduction and verification

    Link

    Rejected program

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

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2011 diagnostic-tpz2011 at example.tpz:1:21

    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 { value }
    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