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

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

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

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

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

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

    The module graph contains a cyclic import dependency.

    Diagnostic and cause

    Ссылка

    Import cycle

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

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

    A directed cycle in the module import graph produces TPZ3006.

    Действия

    Remove a dependency from the cycle or put shared declarations in a third module that both modules can import.

    Compiler phase: resolve.

    Compiler explanation: The module graph contains a cyclic import dependency.

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

    • import cycle: ⟨value⟩ Source
    • module imports itself: ⟨value⟩ Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ3006]: import cycle: first -> second -> first

    The import graph leads back to a module already on the dependency path. The example forms first -> second -> first.

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

    Trigger and repair

    A directed cycle in the module import graph produces TPZ3006.

    Response

    Ссылка

    Remove a dependency from the cycle or put shared declarations in a third module that both modules can import.

    Reproduction and verification

    Ссылка

    Rejected program

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

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

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

    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 first
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    first.tpzCorrected programОткрыть песочницу →
    1. import second
    2. export let one = 1
    second.tpzCorrected programОткрыть песочницу →
    1. export let two = 2
    Ожидаемый результат

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

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

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

    Меню

    Загрузка →