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. factory must be the direct callee of a call.
Using the factory itself as a value produces TPZ5500 during checking.
Связанное правило · Generated rule factory references →Действия
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.
Cause
СсылкаGenerated rule factory references
A generated std. 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
Ссылкаimport std.lispex.rules { approve }let rule = approve()
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 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
Ссылкаimport std.lispex.rules { approve }let factory = approve
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
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.