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

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

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

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

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

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

    Explains rejection of an escaping rule factory in std.lispex.rules.

    Identity and cause

    Ссылка

    Generated rule factory used as a value

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

    Доступность

    Включено по умолчанию · Не определено

    An admitted package lock and its actual std.lispex.rules generated binding are required.

    The SELF producer and its pipeline call are source reviewed. Installed-product exposure and default-distribution availability remain Pending.

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

    A generated std.lispex.rules factory must be the direct callee of a call.

    Using the factory itself as a value produces TPZ5500 during checking.

    Действия

    Invoke the generated factory directly with the limits required by Generated rule factories. Do not store, return, or pass the factory itself. The admitted lock determines its name and the returned handle follows the standard library contract.

    Правилоtopaz.rule.rule-factory.direct-call

    Generated rule factory references

    A generated std.lispex.rules factory must be the direct callee of a call.

    Using the factory itself as a value produces TPZ5500 during checking.

    The public 5.21.3 examples on this page check placement with the 5.21 factory signature. Topaz 6.0 defines its signature and preparation limits in Generated rule factories. The locked-factory example specifies the 6.0 call.

    Причина

    A direct callee identifies the selected lock binding. Passing the factory as a value would hide that selection.

    This restriction applies to generated rule factories, not to every function with no parameters. It is checked before execution and does not by itself report a failure while evaluating a Lispex rule.

    Response

    Ссылка

    Invoke the generated factory directly with the limits required by Generated rule factories. Do not store, return, or pass the factory itself. The admitted lock determines its name and the returned handle follows the standard library contract.

    Generated factory examples

    Ссылка

    Call the generated factory directly

    Ссылка
    src/main.tpzCall the generated factory directlyОткрыть песочницу →
    1. import std.lispex.rules { approve }
    2. let rule = approve()
    Ожидаемый выводКод завершения 0
    $ topaz check src/main.tpz --compiler self · Целевой продукт 5.21.3
    Ожидаемый результат

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

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

    This public 5.21.3 example checks factory placement with the maintained 5.21 application package and its committed lock. Replace src/main.tpz without changing that package.

    Reject a generated factory used as a value

    Ссылка
    src/main.tpzReject a generated factory used as a valueОткрыть песочницу →
    1. import std.lispex.rules { approve }
    2. let factory = approve
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check src/main.tpz --compiler self · Целевой продукт 5.21.3
    Ожидаемый результат

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

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

    • TPZ5500 →

      generated-rule-factory-value-escape at src/main.tpz:2:15

    This public 5.21.3 example checks factory placement with the maintained 5.21 application package and its committed lock. Replace src/main.tpz without changing that package.

    Verification

    Ссылка

    Related entries

    Ссылка

    check →

    Меню

    Загрузка →