Identity and cause
LinkTPZ5523
- Family
- topaz
- Phase
- check
- Code
TPZ5523
Cause and conditions
Each type parameter names a resolved protocol identity once. Repeating that identity produces TPZ5523, including through namespace qualification or aliases. A distinct protocol declaration remains a different requirement even when another module gives it the same name.
Related rule: Repeated protocol boundsResponse
Source evidence
- Bound diagnostics at
d61f9fd0efb0· 177-191
A function declaration names the same protocol more than once in the bounds of one type parameter. The checker compares the protocol name together with the type-parameter index. Repetition on one parameter is distinct from using that protocol on two different parameters. It attaches TPZ5523 to the repeated bound.
Rejected example
LinkRepeated-bound example
Linkfunction duplicate<T: Show + Show>(value: T) -> T {value}
Expected result
Expected result
Rejection during check. Nonzero exit.
TPZ5523repeated-protocol-bound atexample.tpz:1:30
TPZ5523 points to the second Show at example.. Each later occurrence for the same type parameter is diagnosed. Checking continues, so other applicable diagnostics may also appear. Remove the repeated bound to correct this program. The earlier receipt predates the location assertion; CI must execute this revision.
Observed: The authored exit and diagnostic-cause assertions passed. The primary-location assertion and additional-diagnostics policy remain pending. Recorded with Topaz 5.21.3 in run 42147883818 at 2026-. Document source: 1d6f9265d918.
Source evidence
- Functions and generics manuscript at
d61f9fd0efb0· 5.3D - checkFunctionDeclarationInner bound iteration at
151141d7bb44· 177-191
Fix
LinkKeep one occurrence of each required protocol. If additional, distinct protocols are required, retain those bounds. This correction removes repetition; the repaired example checks the complete program.
Repeated bound removed
Linkfunction duplicate<T: Show>(value: T) -> T {value}
example.tpz: types-ok (1 module) example.tpz: resolve-ok (1 module)
Expected result
Expected result
Checking accepts the program. Exit code 0.
Observed assertions · passed · 5.21.3
Exit code 0.
example.tpz: types-ok (1 module)example.tpz: resolve-ok (1 module)
No stderr.
- Passed · expected 0; observed 0
Acceptance of this corrected complete program is a separate check.
Observed: The authored assertions passed. Recorded with Topaz 5.21.3 in run 42147883818 at 2026-. Document source: 1d6f9265d918.
Source evidence
- Functions and generics manuscript at
d61f9fd0efb0· 5.3D
Verification
LinkThe examples reuse the exact source, independent expectations, and product observations shown in Functions and generics. The required primary location and additional-diagnostic policy remain Pending.
Related rules
LinkExported functions also have restrictions on exposing module-local protocols. Those are reported separately as TPZ5524 and are not repaired merely by removing duplicates.