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

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

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

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

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

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

    The source uses a module syntax form reserved but not defined by the current grammar.

    Diagnostic and cause

    Ссылка

    Reserved module form

    Семейство
    topaz
    Этап
    parse
    Код
    TPZ2008

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

    Module imports use dotted identifier paths. String and template paths and use items are rejected.

    Действия

    Write import lib and provide the corresponding module file. Use import for module imports.

    Compiler phase: parse.

    Compiler explanation: The source uses a module syntax form reserved but not defined by the current grammar.

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

    • string and template module paths are reserved and unused; module paths are dotted identifiers Source
    • use is reserved and unused; did you mean import? Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ2008]: string and template module paths are reserved and unused; module paths are dotted identifiers

    The import uses a quoted module path. Module paths are dotted identifiers. The reserved use item produces the same diagnostic.

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

    Trigger and repair

    Module imports use dotted identifier paths. String and template paths and use items are rejected.

    Response

    Ссылка

    Write import lib and provide the corresponding module file. Use import for module imports.

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. import "lib"
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

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

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

    The expected diagnostic, cause, source location, and accompanying diagnostics are specified below. The verification status records whether this program has been run.

    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.

    Меню

    Загрузка →