Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Diagnostics

    TPZ5031: Unsupported extern ABI type

    An extern function signature uses a type outside the deterministic concrete ABI allow-list.

    Diagnostic and cause

    Link

    Unsupported 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 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.

    Rulediagnostics.tpz5031.p5.rule

    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

    Response

    Link

    Replace the unsupported signature type with an admitted concrete data shape. Keep generic or callable values behind a Topaz wrapper.

    Reproduction and verification

    Link

    Rejected program

    Link
    main.tpzRejected programOpen in Playground
    1. import host.math { twice }
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. Ok(0)
    4. }
    Expected outputNonzero exit
    No stdout.
    $ topaz check --language-version 5.21 --compiler self · target product 5.21.3
    topaz.tomlRejected programOpen in Playground
    1. [package]
    2. name = "diagnostic_extern"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [extern.host.math]
    7. hash = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    8. abi_hash = "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
    9. [[extern.host.math.functions]]
    10. name = "twice"
    11. params = ["T"]
    12. result = "int"
    13. [extern.host.math.replay]
    14. fixture = "replay/host-math.jsonl"
    15. [extern.host.math.sandbox]
    16. kind = "replay"
    replay/host-math.jsonlRejected programOpen in Playground
    1. {"module":"host.math","function":"twice","args":[{"$":"int","value":"21"}],"result":{"$":"int","value":"42"}}
    Expected result

    Expected result

    Rejection during package. Nonzero exit.

    • TPZ5031 diagnostics-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

    Repaired program

    Link
    main.tpzRepaired programOpen in Playground
    1. import host.math { twice }
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. Ok(0)
    4. }
    Expected outputexit 0
    $ topaz check --language-version 5.21 --compiler self · target product 5.21.3
    topaz.tomlRepaired programOpen in Playground
    1. [package]
    2. name = "diagnostic_extern"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [extern.host.math]
    7. hash = "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    8. abi_hash = "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
    9. [[extern.host.math.functions]]
    10. name = "twice"
    11. params = ["int"]
    12. result = "int"
    13. [extern.host.math.replay]
    14. fixture = "replay/host-math.jsonl"
    15. [extern.host.math.sandbox]
    16. kind = "replay"
    replay/host-math.jsonlRepaired programOpen in Playground
    1. {"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

    Menu

    Download