-
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
Inferring tracked #21628
Open
KacperFKorban
wants to merge
18
commits into
scala:main
Choose a base branch
from
dotty-staging:infer-tracked
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Inferring tracked #21628
+347
−38
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
KacperFKorban
force-pushed
the
infer-tracked
branch
4 times, most recently
from
October 28, 2024 13:27
d1562cb
to
65a5ddd
Compare
Test logs for after enabling a subset of |
KacperFKorban
force-pushed
the
infer-tracked
branch
from
November 15, 2024 09:52
5b0c484
to
8073932
Compare
KacperFKorban
force-pushed
the
infer-tracked
branch
from
November 18, 2024 21:10
1c1e7c0
to
8fded39
Compare
KacperFKorban
force-pushed
the
infer-tracked
branch
from
December 6, 2024 16:01
8fded39
to
0ce9bab
Compare
…ure" This reverts commit 1e2c226.
KacperFKorban
force-pushed
the
infer-tracked
branch
from
December 10, 2024 15:23
0ce9bab
to
7442d5a
Compare
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.
Infer
tracked
for parameters that are referenced in the public signatures of the defining class.e.g.
In the example above,
ord
is referenced in the signatures of the public members ofOrdSet
, so atracked
modifier will be inserted automatically.Aldo generalize the condition for infering tracked for context bounds. Explicit
using val
witnesses will now also betracked
by default.This implementation should be safe with regards to not introducing spurious cyclic reference errors.
Current limitations (I'll create separate issues for them, once this is merged):
tracked
for given classes is done after the desugaring to class + def, so the def doesn't know abouttracked
being set on the original constructor parameter. This might be worked around by watching the original symbol or adding an attachment pointer to the implicit wrapper.tracked
arguments in parents doesn't work, since forcing a parent (term) isn't safe.This can be replaced with a lint that is checked after Namer.