Skip to content

Missing inheritance check for Capability classes #23223

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
noti0na1 opened this issue May 21, 2025 · 0 comments · May be fixed by #23248
Open

Missing inheritance check for Capability classes #23223

noti0na1 opened this issue May 21, 2025 · 0 comments · May be fixed by #23248
Assignees
Labels
area:experimental:cc Capture checking related itype:bug

Comments

@noti0na1
Copy link
Member

Compiler version

3.nightly (3.7.2-RC1-bin-20250520-baac46c-NIGHTLY)

Minimized code

import language.experimental.captureChecking
import caps.*

class A:
  def a: A = this

class B extends A, Capability

def leak(b: B): A = b.a

Output

Run: scala compile --server=false -S 3.nightly Stest.scala

Compile success.

Expectation

Reject, as we treat B as impure, and it should fail on inheritance check (maybe by checkSelfAgainstParents)

@noti0na1 noti0na1 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:experimental:cc Capture checking related and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 21, 2025
@noti0na1 noti0na1 self-assigned this May 22, 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

Successfully merging a pull request may close this issue.

1 participant