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

    TPZ5720: Unknown loop label

    A labeled break or continue names a loop label that is not in scope.

    Diagnostic and cause

    Link

    Unknown loop label

    Family
    topaz
    Phase
    check
    Code
    TPZ5720

    Cause and conditions

    A labeled break must name an enclosing loop that is active at the statement. Breaking to an absent label is rejected with TPZ5720 at the break statement.

    Response

    Declare the intended label immediately after loop, or use the label of an enclosing loop. The repaired program declares the label used by its break.

    Source evidence

    Compiler phase: check.

    Compiler explanation: A labeled break or continue names a loop label that is not in scope.

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

    • no loop labeled '⟨value⟩ in scope Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ5720]: no loop labeled 'missing in scope

    A labeled break must name an enclosing loop that is active at the statement. Breaking to an absent label is rejected with TPZ5720 at the break statement.

    Rulediagnostics.tpz5720.p5.rule

    Labeled break needs an enclosing loop

    A labeled break must name an enclosing loop that is active at the statement. Breaking to an absent label is rejected with TPZ5720 at the break statement.

    Source evidence

    Response

    Link

    Declare the intended label immediately after loop, or use the label of an enclosing loop. The repaired program declares the label used by its break.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. loop {
    2. break 'missing
    3. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5720 diagnostic-tpz5720 at example.tpz:2:3
    Source evidence

    Repaired program

    Link
    example.tpzRepaired program
    1. loop 'missing {
    2. break 'missing
    3. }
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Source evidence

    Menu

    Download