Diagnostic and cause
LinkUnsupported extern ABI type
- Family
- topaz
- Phase
- package
- Code
TPZ5031
Cause and conditions
Extern ABI signatures admit unit, bool, int, float, string, Bytes, Array<T>, Option<T>, and Result<T,E>, with their type arguments recursively admitted. A free type variable such as T is rejected.
Response
Replace the unsupported signature type with an admitted concrete data shape. Keep generic or callable values behind a Topaz wrapper.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 770-778 - compiler/crates/topaz_package/src/manifest/abi.rs at
151141d7bb44· 31-64 - compiler/crates/topaz_package/src/manifest/sections.rs at
151141d7bb44· 424-434 - compiler/crates/topaz_package/src/model.rs at
151141d7bb44· 233-253 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 52-61 - compiler/crates/topaz_package/src/tests/manifest.rs at
151141d7bb44· 512-537 - compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 770-778
Compiler phase: check/package.
Compiler explanation: An extern function signature uses a type outside the deterministic concrete ABI allow-list.
Message templates are Pending. The explanation above is not an observed CLI message.
Extern ABI signatures admit unit, bool, int, float, string, Bytes, Array<T>, Option<T>, and Result<T,E>, with their type arguments recursively admitted. A free type variable such as T is rejected.
Unsupported extern ABI type
Extern ABI signatures admit unit, bool, int, float, string, Bytes, Array<T>, Option<T>, and Result<T,E>, with their type arguments recursively admitted. A free type variable such as T is rejected.
Source evidence
- compiler/crates/topaz_package/src/manifest/abi.rs at
151141d7bb44· 31-64 - compiler/crates/topaz_package/src/manifest/sections.rs at
151141d7bb44· 424-434 - compiler/crates/topaz_package/src/model.rs at
151141d7bb44· 233-253 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 52-61 - compiler/crates/topaz_package/src/tests/manifest.rs at
151141d7bb44· 512-537 - compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 770-778
Response
LinkReplace the unsupported signature type with an admitted concrete data shape. Keep generic or callable values behind a Topaz wrapper.
Reproduction and verification
LinkRejected program
Linkimport host.math { twice }export function main(args: Array<string>, stdin: string) -> Result<int, string> {Ok(0)}
No stdout.
[package]name = "diagnostic_extern"version = "0.1.0"language = "5.21"entry = "main.tpz"[extern.host.math]hash = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"abi_hash = "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"[[extern.host.math.functions]]name = "twice"params = ["T"]result = "int"[extern.host.math.replay]fixture = "replay/host-math.jsonl"[extern.host.math.sandbox]kind = "replay"
{"module":"host.math","function":"twice","args":[{"$":"int","value":"21"}],"result":{"$":"int","value":"42"}}
Expected result
Expected result
Rejection during package. Nonzero exit.
TPZ5031diagnostics-unsupported-extern-abi-type
The required primary-location contract is Pending.
The ABI rejection rule and the missing diagnostic-code path are established by source. The current PackageError has no coded diagnostic or source-span producer, so an exact primary location for TPZ5031 cannot be derived and remains Pending. This complete package fixture uses invocationArgs without a positional source file.
Source evidence
- compiler/crates/topaz_package/src/manifest/abi.rs at
151141d7bb44· 31-64 - compiler/crates/topaz_package/src/manifest/sections.rs at
151141d7bb44· 424-434 - compiler/crates/topaz_package/src/model.rs at
151141d7bb44· 233-253 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 52-61 - compiler/crates/topaz_package/src/tests/manifest.rs at
151141d7bb44· 512-537 - compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 770-778
Repaired program
Linkimport host.math { twice }export function main(args: Array<string>, stdin: string) -> Result<int, string> {Ok(0)}
[package]name = "diagnostic_extern"version = "0.1.0"language = "5.21"entry = "main.tpz"[extern.host.math]hash = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"abi_hash = "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"[[extern.host.math.functions]]name = "twice"params = ["int"]result = "int"[extern.host.math.replay]fixture = "replay/host-math.jsonl"[extern.host.math.sandbox]kind = "replay"
{"module":"host.math","function":"twice","args":[{"$":"int","value":"21"}],"result":{"$":"int","value":"42"}}
Expected result
Expected result
Checking accepts the program. Exit code 0.
The ABI rejection rule and the missing diagnostic-code path are established by source. The current PackageError has no coded diagnostic or source-span producer, so an exact primary location for TPZ5031 cannot be derived and remains Pending. This complete package fixture uses invocationArgs without a positional source file.
Source evidence
- compiler/crates/topaz_package/src/manifest/abi.rs at
151141d7bb44· 31-64 - compiler/crates/topaz_package/src/manifest/sections.rs at
151141d7bb44· 424-434 - compiler/crates/topaz_package/src/model.rs at
151141d7bb44· 233-253 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 52-61 - compiler/crates/topaz_package/src/tests/manifest.rs at
151141d7bb44· 512-537 - compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 770-778