Diagnostic and cause
LinkType alias cycle
- Family
- topaz
- Phase
- check
- Code
TPZ5023
Cause and conditions
Transparent type aliases must normalize without a cycle.
Related rule: Type alias cycleResponse
Remove the cycle or introduce a nominal record, enum, or newtype boundary that expresses the intended data structure.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 721-729 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 733-743 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 585-608 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 936-960 - compiler/crates/topaz_check/src/form/formation.rs at
151141d7bb44· 879-886
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.
Type alias cycle
Transparent type aliases must normalize without a cycle.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 733-743 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 585-608 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 936-960 - compiler/crates/topaz_check/src/form/formation.rs at
151141d7bb44· 879-886
Response
LinkRemove the cycle or introduce a nominal record, enum, or newtype boundary that expresses the intended data structure.
Reproduction and verification
LinkRejected program
Linktype First = Secondtype Second = Firstlet value: First = 1
No stdout.
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5023diagnostics-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
- compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 733-743 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 585-608 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 936-960 - compiler/crates/topaz_check/src/form/formation.rs at
151141d7bb44· 879-886
Repaired program
Linktype First = inttype Second = Firstlet value: First = 1
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
- compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 733-743 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 585-608 - compiler/crates/topaz_self_frontend/topaz/checker/nominals.tpz at
151141d7bb44· 936-960 - compiler/crates/topaz_check/src/form/formation.rs at
151141d7bb44· 879-886