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.
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
Ссылкаfunction classify(value: int) -> int {match (value) {case 1 => 1}}let result = classify(9)
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
match-not-exhaustive at
example.tpz:2:3
Adding a final unconditional arm repairs the match.
Repaired program
Ссылкаfunction classify(value: int) -> int {match (value) {case 1 => 1case _ => 0}}let result = classify(9)
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
Adding a final unconditional arm repairs the match.