Diagnostic and cause
LinkImported module exports nothing
- Family
- topaz
- Phase
- resolve
- Code
TPZ3010
Cause and conditions
Historical SELF behavior: importing a module with no exported declarations produces TPZ3010. The recommended Modules contract permits an empty-export namespace import and uses TPZ3009 when an absent member is selected. The namespace acceptance and current-product limitation on the Modules page are the normative /v6.0/en/docs expectations for that decision; the reproduction below preserves the historical diagnostic identity.
Related rule: Trigger and repairResponse
For the current SELF product, put initialization in the entry or expose a real public operation that the application needs. The recommended contract requires no dummy export: an ordinary namespace import can initialize a module with no public members. TPZ3010 remains reserved for the historical restriction and is not reassigned.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 427-435 - compiler/crates/topaz_self_frontend/topaz/resolver/validation_init.tpz at
151141d7bb44· 187-187 - compiler/crates/topaz_self_frontend/topaz/resolver/validation_init.tpz at
151141d7bb44· 174-192 - TPZ3010 at
151141d7bb44
Compiler phase: resolve.
Compiler explanation: A module import targets a module with no exported surface.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
⟨value⟩exports nothing; v5.2 has no side-effect-only imports Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ3010]:
libexports nothing; v5.2 has no side-effect-only imports
Historical SELF restriction: the imported module has an empty export table. The recommended uniform module contract permits that namespace import and initializes the module normally.
Trigger and repair
Historical SELF behavior: importing a module with no exported declarations produces TPZ3010. The recommended Modules contract permits an empty-export namespace import and uses TPZ3009 when an absent member is selected. The namespace acceptance and current-product limitation on the Modules page are the normative /v6.0/en/docs expectations for that decision; the reproduction below preserves the historical diagnostic identity.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/resolver/validation_init.tpz at
151141d7bb44· 174-192 - TPZ3010 at
151141d7bb44
Response
LinkFor the current SELF product, put initialization in the entry or expose a real public operation that the application needs. The recommended contract requires no dummy export: an ordinary namespace import can initialize a module with no public members. TPZ3010 remains reserved for the historical restriction and is not reassigned.
Reproduction and verification
LinkRejected program
Linkimport lib
No stdout.
let privateValue = 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· 427-435 - compiler/crates/topaz_self_frontend/topaz/resolver/validation_init.tpz at
151141d7bb44· 187-187 - compiler/crates/topaz_self_frontend/topaz/resolver/validation_init.tpz at
151141d7bb44· 174-192 - TPZ3010 at
151141d7bb44
Corrected program
Linkimport lib
export let privateValue = 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/validation_init.tpz at
151141d7bb44· 174-192 - TPZ3010 at
151141d7bb44