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

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

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

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

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

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

    A module source exceeds the compiler's bounded source-map size.

    Diagnostic and cause

    Ссылка

    Module source is too large

    Семейство
    topaz
    Этап
    resolve
    Код
    TPZ3003

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

    An imported file that is not valid UTF-8 produces TPZ3003 at its import path.

    Действия

    Save the source as valid UTF-8 and make the module file and its containing directories readable. For a size-related failure, split the source into smaller modules.

    Compiler phase: resolve.

    Compiler explanation: A module source exceeds the compiler's bounded source-map size.

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

    • cannot load entry ⟨value⟩: ⟨value⟩ Source
    • cannot load entry ⟨value⟩: source is not valid UTF-8 Source
    • cannot inspect module path for ⟨value⟩: ⟨value⟩ Source

    The resolver cannot read a source file or inspect a module directory. Invalid UTF-8 produces this diagnostic as well. The reproduction replaces lib.tpz with the single byte ff.

    Правилоdiagnostics.tpz3003.rule

    Trigger and repair

    An imported file that is not valid UTF-8 produces TPZ3003 at its import path.

    Response

    Ссылка

    Save the source as valid UTF-8 and make the module file and its containing directories readable. For a size-related failure, split the source into smaller modules.

    Reproduction and verification

    Ссылка

    Product diagnostic test

    Ссылка
    example.tpzProduct diagnostic testОткрыть песочницу →
    1. import lib
    Целевой продукт 5.21.3
    Ожидаемый результат

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

    The separate diagnostic product test validates this command, runtime diagnostic, or filesystem setup. The shared example runner does not execute that assertion plan.

    Prepare the files shown above, then complete this setup.

    Write the hexadecimal byte sequence ff to lib.tpz.

    Run topaz check example.tpz --language-version 5.21.

    Expect exit status 1, empty standard output, and TPZ3003.

    The resolver cannot read a source file or inspect a module directory. Invalid UTF-8 produces this diagnostic as well. The reproduction replaces lib.tpz with the single byte ff.

    The primary location is example.tpz:1:8.

    Expect exactly one diagnostic.

    The diagnostic product test checks these expectations with the same files and command.

    Corrected program

    Ссылка
    example.tpzCorrected programОткрыть песочницу →
    1. import lib
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    lib.tpzCorrected programОткрыть песочницу →
    1. export let value = 1
    Ожидаемый результат

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

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

    This program applies the repair described above. The verification status records whether it has been run.

    Меню

    Загрузка →