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

    TPZ3011: Mutable export is rejected

    A module tries to export a mutable let binding.

    Diagnostic and cause

    Link

    Mutable export is rejected

    Family
    topaz
    Phase
    resolve
    Code
    TPZ3011

    Cause and conditions

    An exported mutable let binding produces TPZ3011.

    Response

    Export an immutable binding. Use a separate operation when callers need to request a change.

    Source evidence

    Compiler phase: resolve.

    Compiler explanation: A module tries to export a mutable let binding.

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

    • export let mut is a static error: exported bindings are immutable views Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ3011]: export let mut is a static error: exported bindings are immutable views

    The declaration combines export with let mut. Exported bindings provide immutable views.

    Rulediagnostics.tpz3011.rule

    Trigger and repair

    An exported mutable let binding produces TPZ3011.

    Source evidence

    Response

    Link

    Export an immutable binding. Use a separate operation when callers need to request a change.

    Reproduction and verification

    Link

    Rejected program

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

    Expected result

    Rejection during resolve. Nonzero exit.

    • TPZ3011 diagnostic-tpz3011 at example.tpz:1:16

    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 program
    1. export let value = 1
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    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