Skip to content

Mark API-acyclic container types as cycle-free - #3970

Open
Yu-zh wants to merge 1 commit into
mainfrom
Yu-zh/cycle-free-annotation
Open

Mark API-acyclic container types as cycle-free#3970
Yu-zh wants to merge 1 commit into
mainfrom
Yu-zh/cycle-free-annotation

Conversation

@Yu-zh

@Yu-zh Yu-zh commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add #unsafe_cycle_free to recursive container representations that cannot form cycles through their public APIs
  • cover linked hash maps, immutable arrays/maps/sets/vectors, lists, sorted maps, and sorted sets

Rationale

These types are structurally recursive and therefore look cycle-capable to conservative analysis, but their exposed APIs do not permit constructing reference cycles. The annotations make that invariant explicit without changing the public API or observable behavior.

Validation

  • moon info (no public interface changes)
  • moon fmt
  • moon check --warn-list +unnecessary_annotation
  • moon test — 7,000 tests passed

@Yu-zh
Yu-zh marked this pull request as ready for review August 3, 2026 14:45
@Yu-zh
Yu-zh force-pushed the Yu-zh/cycle-free-annotation branch from a8fb5a6 to 20f1d28 Compare August 4, 2026 02:01
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 5726

Coverage remained the same at 90.458%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 17754
Covered Lines: 16060
Line Coverage: 90.46%
Coverage Strength: 171355.33 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants