Diagnostic and cause
СсылкаMalformed concurrent form
- Семейство
- topaz
- Этап
- parse
- Код
TPZ2005
Причина и условия
A concurrent expression has an else block exactly when it has a timeout argument. Each arm has a name followed by : and an expression.
Действия
Remove the else block for concurrent without a timeout. When selecting a timeout, write timeout: followed by a duration and provide an else block.
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.
concurrenttakes only atimeout:argument Sourceelserequires theconcurrent(timeout: .form Source. . ) - the
concurrent(timeout: .form requires an. . ) elseblock 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.
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.
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.
Reproduction and verification
СсылкаRejected program
Ссылкаlet value = concurrent { first: 1 } else { 0 }
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения parse. Ненулевой код завершения.
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.
Corrected program
Ссылкаlet value = concurrent { first: 1 }
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
This program applies the repair described above. The verification status records whether it has been run.