Skip to content

Fix #23737: Update superCallContext to include dummy capture parameters in scope #23740

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

Merged
merged 3 commits into from
Aug 15, 2025

Conversation

noti0na1
Copy link
Member

Fix #23737

@noti0na1 noti0na1 marked this pull request as ready for review August 14, 2025 20:41
Copy link
Contributor

@natsukagami natsukagami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to also include a test like this, to ensure that the subtyping relationship works

import language.experimental.captureChecking

class C

trait A[T]

trait B[Cap^] extends A[C^{Cap}]

def f(c: C^) =
  val b = new B[{c}] {}
  val a: A[C^{c}] = b

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic looks good to me.

@noti0na1 noti0na1 enabled auto-merge August 15, 2025 08:29
@noti0na1 noti0na1 merged commit 8d20b2a into scala:main Aug 15, 2025
48 checks passed
@noti0na1 noti0na1 deleted the fix-23737 branch August 15, 2025 15:04
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.

Capture set variable does not work for class parameter
3 participants