Diagnostic and cause
СсылкаMutable export is rejected
- Семейство
- topaz
- Этап
- resolve
- Код
TPZ3011
Причина и условия
An exported mutable let binding produces TPZ3011.
Связанное правило · Trigger and repair →Действия
Export an immutable binding. Use a separate operation when callers need to request a change.
Compiler phase: resolve.
Compiler explanation: A module tries to export a mutable let binding.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
export let mutis a static error: exported bindings are immutable views Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ3011]:
export let mutis a static error: exported bindings are immutable views
The declaration combines export with let mut. Exported bindings provide immutable views.
Response
СсылкаExport an immutable binding. Use a separate operation when callers need to request a change.
Reproduction and verification
СсылкаRejected program
Ссылкаexport let mut value = 1
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения resolve. Ненулевой код завершения.
diagnostic-tpz3011 at
example.tpz:1:16
The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.
Corrected program
Ссылкаexport let value = 1
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
This program applies the repair described above. The verification status records whether it has been run.