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

    TPZ4006: Retired in 6.0.0

    TPZ4006 is retired in Topaz 6.0.0. Its former meaning was a runtime match with no matching arm. The code must not be emitted or assigned a new meaning.

    Diagnostic and cause

    Link

    Match missed at runtime

    Family
    topaz
    Phase
    run
    Code
    TPZ4006

    Cause and conditions

    Response

    Make the match exhaustive. Open input types need a final unguarded wildcard or name pattern.

    Source evidence

    Historical compiler facts for the reserved code. These facts describe the former diagnostic, not a 6.0.0 trigger.

    Compiler phase: runtime.

    Compiler explanation: A runtime match expression reached no matching arm.

    Message templates are Pending. The explanation above is not an observed CLI message.

    TPZ4006 is retired in Topaz 6.0.0. Its former meaning was a runtime match with no matching arm. The code must not be emitted or assigned a new meaning.

    Rulediagnostics.tpz4006.p5.rule

    Reserved runtime code and current checking diagnostic

    TPZ4006 is retired in Topaz 6.0.0. Its code and former meaning, runtime match failure, remain reserved and must not be reused. An incomplete match produces TPZ5021 during checking under match exhaustiveness.

    Why

    Checking every match removes a separate runtime failure for missing cases. A reserved code keeps historical diagnostics and links understandable.

    Source evidence

    Response

    Link

    Make the match exhaustive. Open input types need a final unguarded wildcard or name pattern.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. function classify(value: int) -> int {
    2. match (value) {
    3. case 1 => 1
    4. }
    5. }
    6. let result = classify(9)
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5021 match-not-exhaustive at example.tpz:2:3

    Adding a final unconditional arm repairs the match.

    Source evidence

    Repaired program

    Link
    example.tpzRepaired program
    1. function classify(value: int) -> int {
    2. match (value) {
    3. case 1 => 1
    4. case _ => 0
    5. }
    6. }
    7. let result = classify(9)
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Adding a final unconditional arm repairs the match.

    Source evidence

    Current diagnostic

    Link

    Non-exhaustive match

    Menu

    Download