Skip to content

Change retains annotation from using term arguments to using type arguments #22909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

noti0na1
Copy link
Member

@noti0na1 noti0na1 commented Apr 2, 2025

Fix #22842

This PR updates the retains annotation to use type arguments instead of term arguments in order to streamline capture set representations and related type checking. Key changes include:

  • Adjusting the looking up for capture variables in capture sets, by creating dummy term symbols.
  • Removing term parameter for retains annotation and capsOf.
  • Modifying annotation construction in RetainingType, CaptureAnnotation, and associated AST desugarings.

For example,

def f[C^](x: A^): B @retains[x.type | C] // B^{x, C}

@noti0na1 noti0na1 marked this pull request as ready for review May 15, 2025 20:28
@noti0na1 noti0na1 self-assigned this May 15, 2025
@noti0na1 noti0na1 requested a review from Copilot May 15, 2025 20:28
Copilot

This comment was marked as resolved.

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.

Change representation of retains annotation?
1 participant