Skip to content

Impure type arguments in user-written types is not boxed during CC setup #20169

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

Closed
Linyxus opened this issue Apr 11, 2024 · 0 comments · Fixed by #20221
Closed

Impure type arguments in user-written types is not boxed during CC setup #20169

Linyxus opened this issue Apr 11, 2024 · 0 comments · Fixed by #20221
Assignees
Labels
area:experimental:cc Capture checking related itype:bug
Milestone

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Apr 11, 2024

I checked the issue again and it turns out that actually the recent reproduction is completely a new one with a different cause. Another minimisation that is more salient:

def runOps(ops: List[() => Unit]): () -> Unit =
  () =>
    ops.foreach: op =>
      op()

Originally posted by @Linyxus in #16725 (comment)

@Linyxus Linyxus added the area:experimental:cc Capture checking related label Apr 11, 2024
odersky added a commit that referenced this issue Apr 26, 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`.
@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
area:experimental:cc Capture checking related itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants