Skip to content

Leaking reach capabilities for class parameters #23303

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

Open
Linyxus opened this issue Jun 2, 2025 · 0 comments
Open

Leaking reach capabilities for class parameters #23303

Linyxus opened this issue Jun 2, 2025 · 0 comments
Assignees
Labels
area:experimental:cc Capture checking related itype:bug

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Jun 2, 2025

Compiler version

main

Minimized code

import language.experimental.captureChecking
class Runner(ops: List[() => Unit]):
  def execute: Unit = ops.foreach(f => f())

Output

It compiles.

Expectation

It should not.

@Linyxus Linyxus added itype:bug area:experimental:cc Capture checking related labels Jun 2, 2025
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

No branches or pull requests

2 participants