Skip to content

3.4.0 debugging info not reliable in inner lambdas #20067

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
OndrejSpanel opened this issue Apr 2, 2024 · 1 comment
Closed

3.4.0 debugging info not reliable in inner lambdas #20067

OndrejSpanel opened this issue Apr 2, 2024 · 1 comment
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label

Comments

@OndrejSpanel
Copy link
Member

OndrejSpanel commented Apr 2, 2024

Compiler version

3.3.3
3.4.0
3.4.1
3.5.0-RC1-bin-20240331-cc55381-NIGHTLY

Minimized code

I have experienced the issue when trying to verify fix #15841. Code is from https://youtrack.jetbrains.com/issue/SCL-22145.

object Main {
  case class A(s: String = "s", i: Int = 1)

  object Inside {
    def create(a: A) = {
      def func(a: A, count: Int) = {
        (0 until count).map { i =>
          val number = i + 1
          val string = i.toString
          val insideA = A(string, number)
          insideA.s * number
        }

      }
      func(a, 5)
      a
    }
  }

  def main(args: Array[String]): Unit = {
    Inside.create(A())
  }
}

Place breakpoints at

  1. val number = i + 1
  2. insideA.s * number
  3. func(a, 5)

Note: using IntelliJ IntelliJ IDEA 2024.1 RC and Scala plugin 2024.1.596

Expectation

It should be possible to place breakpoints at all those lines

What happens instead

With 3.3.3 all breakpoints are displayed as active, but only 2 and 3 are triggered
With 3.4.0 and 3.4.1 only breakpoints 2 and 3 are displayed as active and triggered
With 3.5.0-RC1-bin-20240331-cc55381-NIGHTLY only breakpoint 3 is displayed as active and triggered. It is impossible to step into the lambda

3.5. screenshot: image

Issue

I am not sure if this is IntelliJ or Scala 3 issue, but Scala 3 seems to be a more likely source.

@OndrejSpanel OndrejSpanel added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 2, 2024
@OndrejSpanel
Copy link
Member Author

I have tested this with metals and all breakpoints work fine. Assuming IntelliJ issue.

@som-snytt som-snytt closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label
Projects
None yet
Development

No branches or pull requests

2 participants