Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Sep 25, 2025

A capset var that is defined in the result type of a val or def cannot accept any
capabilities defined on the RHS. By contrast, a capset defined in the RHS (but not
in local definitions of the RHS) can accept other capabilities defined in that RHS.
Both of these capsets have the same owner, so we need an additional piece of information
to perform level checking correctly.

Fixes #24039.

A capset var that is defined in the result type of a val or def cannot accept any
capabilities defined on the RHS. By contrast, a capset defined in the RHS (but not
in local definitions of the RHS) can accept other capabilities defined in that RHS.
Both of these capsets have the same owner, so we need an additional piece of information
to perform level checking correctly.

Fixes scala#24039.
@odersky
Copy link
Contributor Author

odersky commented Sep 25, 2025

@bracevac Can you check that the test files you created are handled correctly now?

@odersky odersky requested a review from Linyxus September 25, 2025 18:08
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 0ec9468 into scala:main Sep 26, 2025
50 checks passed
@odersky odersky deleted the fix-24039 branch September 26, 2025 11:39
@WojciechMazur WojciechMazur added this to the 3.8.0 milestone Oct 28, 2025
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.

Spurious level errors for Contains

4 participants