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

Wrong subcapture check result when capture parameter presents #22005

Open
noti0na1 opened this issue Nov 22, 2024 · 1 comment · May be fixed by #22000
Open

Wrong subcapture check result when capture parameter presents #22005

noti0na1 opened this issue Nov 22, 2024 · 1 comment · May be fixed by #22000
Labels
area:experimental:cc Capture checking related itype:bug

Comments

@noti0na1
Copy link
Member

Compiler version

Current version
3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-c933560

Minimized code

import language.experimental.captureChecking
import caps.*

class IO
class File(io: IO^)
class Handler[C^]:
  def f(file: File^): File^{C^} = file // should be error!
  def g(file: File^{C^}): File^ = file // ok

def test(io1: IO^, io2: IO^, h: Handler[CapSet^{io2}]) =
  val f1: File^{io1} = ???
  val f2: File^{io2} = h.f(f1) // problem!

Output

Compiled

Expectation

Should reject f

@noti0na1 noti0na1 added itype:bug cc-experiment Intended to be merged with cc-experiment branch on origin stat:needs triage Every issue needs to have an "area" and "itype" label and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 22, 2024
@noti0na1
Copy link
Member Author

cc @odersky @Linyxus @bracevac

@noti0na1 noti0na1 added area:experimental:cc Capture checking related and removed cc-experiment Intended to be merged with cc-experiment branch on origin labels Nov 22, 2024
noti0na1 added a commit to dotty-staging/dotty that referenced this issue Nov 22, 2024
@noti0na1 noti0na1 linked a pull request Nov 22, 2024 that will close this issue
@noti0na1 noti0na1 linked a pull request Nov 29, 2024 that will close this issue
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.

1 participant