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

    TPZ2005: Malformed concurrent form

    A concurrent timeout and else branch are not paired correctly.

    Diagnostic and cause

    Link

    Malformed concurrent form

    Family
    topaz
    Phase
    parse
    Code
    TPZ2005

    Cause and conditions

    A concurrent expression has an else block exactly when it has a timeout argument. Each arm has a name followed by : and an expression.

    Response

    Remove the else block for concurrent without a timeout. When selecting a timeout, write timeout: followed by a duration and provide an else block.

    Source evidence

    Compiler phase: parse.

    Compiler explanation: A concurrent timeout and else branch are not paired correctly.

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

    • concurrent takes only a timeout: argument Source
    • else requires the concurrent(timeout: ...) form Source
    • the concurrent(timeout: ...) form requires an else block Source

    The reproduction attaches an else block to concurrent without a timeout. The timeout form requires an else block, and the form without a timeout rejects one.

    Rulediagnostics.tpz2005.rule

    Trigger and repair

    A concurrent expression has an else block exactly when it has a timeout argument. Each arm has a name followed by : and an expression.

    Source evidence

    Response

    Link

    Remove the else block for concurrent without a timeout. When selecting a timeout, write timeout: followed by a duration and provide an else block.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. let value = concurrent { first: 1 } else { 0 }
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during parse. Nonzero exit.

    • TPZ2005 diagnostic-tpz2005 at example.tpz:1:37

    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. let value = concurrent { first: 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