-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove ^ in capture set syntax #22725
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coolio!
Let's rebase this on #22539 and wait until after the release cutoff before merging. |
I don't think we need to rebase onto the separation checking PR. The change here is only inside the Typer and should be independent to the core cc phase. |
How about all the test cases that need to be updated? I think it's better to rebase. |
This scheme has the advantage that the code is very simple. But there is an issue: Assume we have object C
...
def foo[C^](x: A^{C}) = ... then A^{C} will refer to the outer val C: Capability = ... then we get scope inversion. The outer C will be selected over the inner C. I think we should try to avoid these problems by using a scheme similar to CBCompanion where when we run the Namer on |
I see, if we keep searching terms first, we need to create a "fake" symbol for every type bounded by |
I need to wait for the syntax change in #22758, so it is easier to tell which type def is a capture variable. |
I agree. I first thought this was independent of the syntax changes, but maybe that's not the case. |
@noti0na1 it's fairly complete now, modulo adapting the test cases. |
This PR simplifies the capture set syntax by removing unnecessary
^
symbols in capture sets.This change is the first step making the syntax cleaner and more consistent for capture polymorphism.
InCaptureSet
mode inMode.scala
to handle capture set annotation typing;^
suffix from capture set syntaxInCaptureSet
is set and a term ident or select is not found, retry typing as a type wrapped inCapsOf
.