Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика TPZ5032

    An extern module is missing a deterministic replay fixture, has invalid replay data, or calls an entry not present in replay.

    Diagnostic and cause

    Ссылка

    Invalid extern replay or sandbox binding

    Семейство
    topaz
    Этап
    check
    Код
    TPZ5032

    Причина и условия

    An imported extern module needs a valid deterministic replay binding. Malformed replay data is rejected at the module import.

    Действия

    Provide the replay fixture required by the declared extern module. Correct malformed fixture data and add the missing operation entry.

    Compiler phase: check/package.

    Compiler explanation: An extern module is missing a deterministic replay fixture, has invalid replay data, or calls an entry not present in replay.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • extern module ⟨value⟩ has an invalid deterministic replay binding: ⟨value⟩ Source

    An imported extern module needs a valid deterministic replay binding. Malformed replay data is rejected at the module import.

    Правилоdiagnostics.tpz5032.p5.rule

    Invalid extern replay or sandbox binding

    An imported extern module needs a valid deterministic replay binding. Malformed replay data is rejected at the module import.

    Response

    Ссылка

    Provide the replay fixture required by the declared extern module. Correct malformed fixture data and add the missing operation entry.

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    main.tpzRejected programОткрыть песочницу →
    1. import host.math { twice }
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. Ok(0)
    4. }
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check --language-version 5.21 --compiler self · Целевой продукт 5.21.3
    topaz.tomlRejected programОткрыть песочницу →
    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.jsonlRejected programОткрыть песочницу →
    1. {"module":"host.math","function":"twice","args":"not-array","result":{"$":"int","value":"42"}}
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    • TPZ5032 →

      diagnostics-invalid-extern-replay at main.tpz:1:8

    This complete package fixture uses invocationArgs without a positional source file.

    Repaired program

    Ссылка
    main.tpzRepaired programОткрыть песочницу →
    1. import host.math { twice }
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. Ok(0)
    4. }
    Ожидаемый выводКод завершения 0
    $ topaz check --language-version 5.21 --compiler self · Целевой продукт 5.21.3
    topaz.tomlRepaired programОткрыть песочницу →
    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 programОткрыть песочницу →
    1. {"module":"host.math","function":"twice","args":[{"$":"int","value":"21"}],"result":{"$":"int","value":"42"}}
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    This complete package fixture uses invocationArgs without a positional source file.

    Меню

    Загрузка →