Skip to content

3.4.0 debugging info not reliable in inner lambdas #20067

Closed as not planned
Closed as not planned
@OndrejSpanel

Description

@OndrejSpanel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions