Skip to content

Line number off-by-1 in stack trace #17425

Open
@armanbilge

Description

@armanbilge

Compiler version

3.3.1-RC1-bin-20230504-0e00420-NIGHTLY

Minimized code

package com.example

object Bar {

  def void(): Unit =
    throw new Exception

  def main(args: Array[String]): Unit = {
    this
      .void() // this is line 10
  }
}

Output

Exception in thread "main" java.lang.Exception
        at com.example.Bar$.void(test.scala:6)
        at com.example.Bar$.main(test.scala:9)
        at com.example.Bar.main(test.scala)

Expectation

at com.example.Bar$.main(test.scala:9) would ideally be at com.example.Bar$.main(test.scala:10), right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions