Diagnostic and cause
СсылкаReserved module root
- Семейство
- topaz
- Этап
- resolve
- Код
TPZ3016
Причина и условия
An import whose first path segment is topaz produces TPZ3016 before its module file is loaded.
Связанное правило · Trigger and repair →Действия
Choose a different root name for user modules and update their imports.
Compiler phase: resolve.
Compiler explanation: An import addresses a root reserved by the language or standard library.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- the module path root
topazis reserved; user modules cannot live under it Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ3016]: the module path root
topazis reserved; user modules cannot live under it
The import begins with the reserved module root topaz. A user source file beneath that name does not make the import valid.
Trigger and repair
An import whose first path segment is topaz produces TPZ3016 before its module file is loaded.
Response
СсылкаChoose a different root name for user modules and update their imports.
Reproduction and verification
СсылкаRejected program
Ссылкаimport topaz.custom
Нет стандартного вывода.export let value = 1
Ожидаемый результат
Ожидаемый результат
Этап отклонения resolve. Ненулевой код завершения.
diagnostic-tpz3016 at
example.tpz:1:8
The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.
Corrected program
Ссылкаimport app.custom
export let value = 1
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
This program applies the repair described above. The verification status records whether it has been run.