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

    TPZ5024: Variadic parameter is not final

    A variadic function type or parameter list puts the variadic slot before another slot.

    Diagnostic and cause

    Link

    Variadic parameter is not final

    Family
    topaz
    Phase
    check
    Code
    TPZ5024

    Cause and conditions

    A variadic parameter must be the final parameter of its declaration or function type.

    Response

    Move the variadic parameter to the end of the declaration or function type.

    Source evidence

    Compiler phase: check.

    Compiler explanation: A variadic function type or parameter list puts the variadic slot before another slot.

    Message templates are Pending. The explanation above is not an observed CLI message.

    A variadic parameter must be the final parameter of its declaration or function type.

    Rulediagnostics.tpz5024.p5.rule

    Variadic parameter is not final

    A variadic parameter must be the final parameter of its declaration or function type.

    Source evidence

    Response

    Link

    Move the variadic parameter to the end of the declaration or function type.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. function tail(...values: int, last: int) -> int { last }
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5024 diagnostics-variadic-not-final

    The required primary-location contract is Pending.

    The intended rejection is recorded as an implementation limitation. A current SELF producer does not establish the diagnostic source location, so that location remains Pending.

    Source evidence

    Repaired program

    Link
    example.tpzRepaired program
    1. function tail(last: int, ...values: int) -> int { last }
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    The intended rejection is recorded as an implementation limitation. A current SELF producer does not establish the diagnostic source location, so that location remains Pending.

    Source evidence

    Menu

    Download