-
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
Add capture checking attributes to TASTy #19033
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicolasstucki
force-pushed
the
add-cc-attibutes
branch
4 times, most recently
from
November 27, 2023 08:33
759e518
to
f71121b
Compare
nicolasstucki
force-pushed
the
add-cc-attibutes
branch
from
November 27, 2023 10:08
f71121b
to
658a6b8
Compare
nicolasstucki
added a commit
that referenced
this pull request
Nov 27, 2023
We generalize the internal encoding of `Attributes` to be a list of tags. Then we add add helper methods to have simpler ways to interact with this abstraction using booleans. This implies that the pickling/unpickling can be agnostic of the semantics of each tag. Therefore reducing the number of places that need to be updated when we add a new tag. Useful for #19074, #19033, and #18948.
nicolasstucki
force-pushed
the
add-cc-attibutes
branch
from
November 27, 2023 11:59
658a6b8
to
0b28d58
Compare
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this pull request
Nov 27, 2023
We generalize the internal encoding of `Attributes` to be a list of tags. Then we add add helper methods to have simpler ways to interact with this abstraction using booleans. This implies that the pickling/unpickling can be agnostic of the semantics of each tag. Therefore reducing the number of places that need to be updated when we add a new tag. Useful for scala#19074, scala#19033, and scala#18948.
nicolasstucki
assigned odersky and nicolasstucki and unassigned nicolasstucki and odersky
Nov 27, 2023
nicolasstucki
force-pushed
the
add-cc-attibutes
branch
from
November 28, 2023 07:52
0b28d58
to
76fce2a
Compare
odersky
approved these changes
Nov 28, 2023
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.
Nice cleanup!
nicolasstucki
added a commit
that referenced
this pull request
Jan 3, 2024
We can override the sources of the standard library with cc annotation in this project and generate a TASTy version of the standard library. Usage: ``` sbt> set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty sbt> scala3-bootstrapped/testCompilation sbt> scala3-bootstrapped/test sbt> scala3-bootstrapped/run ... ``` ``` sbt> scala2-library-cc/run diff sbt> scala2-library-cc/run diff scala/Option.scala sbt> scala2-library-cc/run diff scala/collection/immutable ``` ### Current limitations #### Empty self types in library We need to override `Function1` and `PartialFunction` to remove their empty self type. These cause some problem with capture checking. We need to fix these cases. I will open an issue once we have a way to reproduce it with this PR. #### Cannot use the TASTy jar yet There is a bug when we try to class load the captured checked library from TASTy. These are due to some cyclic reference while unpickling the TASTy. <del>The current theory is that this due to the CC annotations in the top-level classes. If this is the case, we can fix this issue by adding these language features as TASTy attributes (see #19033).</del> This was wrong or only part of the problems. The current issue can be reproduced with #19115.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace
@CaptureChecked
and@WithPureFuns
with TASTy attributes.