Skip to content

Conversation

Linyxus
Copy link
Contributor

@Linyxus Linyxus commented Apr 18, 2024

Fixes #20169. Fixes #20224.

It turns out that the type argument in #20169 is properly boxed. It is just that when doing box adaptation, when charging cap into environments it gets discarded by the visibility check.

Right now, a symbol is considered visible in an environment only when the owner of the environment is contained in the symbol. This is not right: when there is not containment relation between the symbol and the environment owner the symbol is also visible from the environment, which is the case here for cap.

@Linyxus Linyxus requested a review from odersky April 18, 2024 13:04
@Linyxus
Copy link
Contributor Author

Linyxus commented Apr 18, 2024

This fix seems to break the cc stdlib. I'll look into it.

@Linyxus Linyxus assigned odersky and unassigned Linyxus Apr 19, 2024
@odersky odersky merged commit 79500f7 into scala:main Apr 26, 2024
@odersky odersky deleted the fix-20169 branch April 26, 2024 10:45
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 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.

Type argument of asInstanceOf is boxed Impure type arguments in user-written types is not boxed during CC setup
3 participants