Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Diagnostics

    TPZ5500: Generated rule factory used as a value

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

    Identity and cause

    Link

    Generated rule factory used as a value

    Family
    topaz
    Phase
    check
    Code
    TPZ5500

    Availability

    Included by default: Pending

    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.

    Source evidence

    Cause and conditions

    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.

    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.

    Source evidence

    Cause

    Link
    Ruletopaz.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.

    Why

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

    Source evidence

    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

    Link

    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

    Link

    Call the generated factory directly

    Link
    src/main.tpzCall the generated factory directlyOpen in Playground
    1. import std.lispex.rules { approve }
    2. let rule = approve()
    Expected outputexit 0
    $ topaz check src/main.tpz --compiler self · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 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.

    Source evidence

    Reject a generated factory used as a value

    Link
    src/main.tpzReject a generated factory used as a valueOpen in Playground
    1. import std.lispex.rules { approve }
    2. let factory = approve
    Expected outputNonzero exit
    No stdout.
    $ topaz check src/main.tpz --compiler self · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • 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.

    Source evidence

    Verification

    Link

    Related entries

    Link

    check

    Menu

    Download