Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика

    TPZ4006 · Удалена в 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

    Ссылка

    Match missed at runtime

    Семейство
    topaz
    Этап
    run
    Код
    TPZ4006

    Причина и условия

    Действия

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

    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.

    Правилоdiagnostics.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.

    Причина

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

    Response

    Ссылка

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

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. function classify(value: int) -> int {
    2. match (value) {
    3. case 1 => 1
    4. }
    5. }
    6. let result = classify(9)
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    Adding a final unconditional arm repairs the match.

    Repaired program

    Ссылка
    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)
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Adding a final unconditional arm repairs the match.

    Current diagnostic

    Ссылка

    Non-exhaustive match →

    Меню

    Загрузка →