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

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

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

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

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

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

    Selecting a private or absent module member produces TPZ3009 even when the module exports no declarations.

    Diagnostic and cause

    Ссылка

    Name is not exported

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

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

    Selecting a private or absent name through an import selection or namespace member produces TPZ3009. An empty export table follows the same rule.

    Действия

    Select an exported name, or add export to the declaration when it belongs in the public API.

    The compiler facts describe the earlier module implementation. The uniform module contract permits empty export tables and rejects unavailable selections with TPZ3009.

    Compiler phase: resolve.

    Compiler explanation: A selected import or namespace member names something the module does not export.

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

    • ⟨value⟩ is not exported by ⟨value⟩⟨value⟩ Source
    • ⟨value⟩ is not exported by ⟨value⟩⟨value⟩ Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ3009]: hidden is not exported by lib

    The selected import or namespace member is absent from the target module's exported declarations. A matching private declaration does not make the name available to importers. The same condition applies when the export table is empty.

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

    Trigger and repair

    Selecting a private or absent name through an import selection or namespace member produces TPZ3009. An empty export table follows the same rule.

    Response

    Ссылка

    Select an exported name, or add export to the declaration when it belongs in the public API.

    Reproduction and verification

    Ссылка

    Rejected program

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

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

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

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

    Меню

    Загрузка →