Skip to content

[Scala 3] Breakpoint within a match expression does not find local variables #241

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
julienrf opened this issue Jun 21, 2022 · 2 comments
Closed
Labels
bug Something isn't working runtime evaluation

Comments

@julienrf
Copy link
Contributor

package foo

def f(n: Int): Int =
  n match
    case m =>
      println("foo") // (1)
      m + m          // (2)

@main def run() =
  println(f(21))

If I put the breakpoint at (1) and try to evaluate m, it fails with a NoSuchElementException: m. If I put the breakpoint at (2), it works as expected.

@adpi2 adpi2 added bug Something isn't working runtime evaluation labels Jun 21, 2022
@adpi2 adpi2 changed the title Breakpoint within a match expression does not find local variables [Scala 3] Breakpoint within a match expression does not find local variables Jun 21, 2022
@adpi2
Copy link
Member

adpi2 commented Jun 27, 2022

Thank you @julienrf, it seems there is a bug in the compiler itself: scala/scala3#15535

adpi2 added a commit to adpi2/scala-debug-adapter that referenced this issue Nov 2, 2022
adpi2 added a commit to adpi2/scala-debug-adapter that referenced this issue Nov 2, 2022
@adpi2
Copy link
Member

adpi2 commented Nov 2, 2022

Fixed in Scala 3.2.1, as shown by the new test in #310

@adpi2 adpi2 closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime evaluation
Projects
None yet
Development

No branches or pull requests

2 participants