Diagnostic and cause
LinkReserved module root
- Family
- topaz
- Phase
- resolve
- Code
TPZ3016
Cause and conditions
An import whose first path segment is topaz produces TPZ3016 before its module file is loaded.
Related rule: Trigger and repairResponse
Choose a different root name for user modules and update their imports.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 481-489 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 695-695 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 679-700 - TPZ3016 at
151141d7bb44
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.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 679-700 - TPZ3016 at
151141d7bb44
Response
LinkChoose a different root name for user modules and update their imports.
Reproduction and verification
LinkRejected program
Linkimport topaz.custom
No stdout.
export let value = 1
Expected result
The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 481-489 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 695-695 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 679-700 - TPZ3016 at
151141d7bb44
Corrected program
Linkimport app.custom
export let value = 1
Expected result
Expected result
Checking accepts the program. Exit code 0.
This program applies the repair described above. The verification status records whether it has been run.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 679-700 - TPZ3016 at
151141d7bb44