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 soundness hole of forgotten reach capabilities #20524

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 4, 2024

Fixes #20503

@odersky odersky requested a review from Linyxus June 4, 2024 22:39
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!

@Linyxus Linyxus merged commit 7abb3d9 into scala:main Jun 4, 2024
19 checks passed
@Linyxus Linyxus deleted the fix-20503 branch June 4, 2024 23:21
Copy link
Member

Choose a reason for hiding this comment

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

The following test failed in nightly with Scala 2 libary CC TASTy.

Wrong number of errors encountered when compiling tests/neg/i20503.scala
expected: 1, actual: 2
Unfulfilled expectations:

Unexpected errors:
tests/neg/i20503.scala:3
-> following the errors:
 at 3: Reach capability cap and universal capability cap cannot both
appear in the type [U](f: box (() ->{ops*} Unit) => U): Unit of this expression
 at 6: Found:    (ops: List[box () ->? Unit]^?) => Unit
Required: (ops: List[box () => Unit]) -> Unit

See: https://github.com/scala/scala3/actions/runs/9377502987/job/25819168381

Copy link
Member

Choose a reason for hiding this comment

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

Fixed by #20528

@odersky
Copy link
Contributor Author

odersky commented Jun 5, 2024

@noti0na1 @Linyxus Can one of you follow up on this please. I don't have the bandwidth right now.

@noti0na1
Copy link
Member

noti0na1 commented Jun 5, 2024

I will look into this error

@odersky
Copy link
Contributor Author

odersky commented Jun 5, 2024

@noti0na1 Thank you!

@noti0na1
Copy link
Member

noti0na1 commented Jun 5, 2024

The extra error is at the type of foreach: [U](f: A => U): Unit.

When compiled with Scala2LibraryCCTasty using the bootstrapped compiler, symbol foreach is considered already checked with CC, so it is not fluidified.

I tried the commit before this PR, and I can trigger the same error using the same setting. So this error is not related to this PR.

noti0na1 added a commit that referenced this pull request Jun 6, 2024
Fix error introduced by a test of #20524.

Due to limitation in expressiveness of current system, we are not able
to map over lists of impure elements. See discussion in #20156.
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 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.

Reach capabilities of function arguments get ignored
5 participants