Skip to content
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

Fix setup of CapSet arguments. #21309

Merged
merged 3 commits into from
Aug 8, 2024
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 31, 2024

These arguments tell the whole truth; they cannot possibly be decorated with another capture set. So we should not add a capture set variable.

Comment on lines +6 to +8
trait Source[+T, Cap^]:
final def await(using ac: Async^{Cap^}) = ac.await[T, Cap](this) // Contains[Cap, ac] is assured because {ac} <: Cap.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't work if Async was declared extends caps.Capability

odersky added 3 commits August 7, 2024 12:48
These arguments tell the whole truth; they cannot possibly be decorated with another capture set. So
we should not add a capture set variable.
These need to be handled like reach capabilities.

Fixes scala#21347
@odersky
Copy link
Contributor Author

odersky commented Aug 8, 2024

@Linyxus Ping for review.

Copy link
Contributor

@Linyxus Linyxus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@odersky odersky merged commit c09154a into scala:main Aug 8, 2024
28 checks passed
@odersky odersky deleted the fix-polycap branch August 8, 2024 15:32
odersky added a commit that referenced this pull request Aug 10, 2024
- Cleanup all inferred types, not just result types of ValDefs and
DefDefs.
- To compensate, map overriding ValDefs and DefDefs to have declared
result types.
 - Make type trees generated for varargs inferred.

Based on #21309.
@WojciechMazur WojciechMazur added this to the 3.6.0 milestone Oct 8, 2024
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.

Polymorphic capture functions can be exploited to hide captures
4 participants