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

    TPZ5023: Type alias cycle

    A type alias expands back to itself through one or more aliases.

    Diagnostic and cause

    Link

    Type alias cycle

    Family
    topaz
    Phase
    check
    Code
    TPZ5023

    Cause and conditions

    Transparent type aliases must normalize without a cycle.

    Response

    Remove the cycle or introduce a nominal record, enum, or newtype boundary that expresses the intended data structure.

    Source evidence

    Compiler phase: check.

    Compiler explanation: A type alias expands back to itself through one or more aliases.

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

    Transparent type aliases must normalize without a cycle.

    Rulediagnostics.tpz5023.p5.rule

    Type alias cycle

    Transparent type aliases must normalize without a cycle.

    Source evidence

    Response

    Link

    Remove the cycle or introduce a nominal record, enum, or newtype boundary that expresses the intended data structure.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. type First = Second
    2. type Second = First
    3. let value: First = 1
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5023 diagnostics-type-alias-cycle

    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. type First = int
    2. type Second = First
    3. let value: First = 1
    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