Closed
Description
Compiler version
3.5.1
Minimized code
The backend computes lines in the classfile by comparing the point offset to the source file of the current compilation unit.
This is problematic for code where the source file is derived from user code, i.e. with code-gen surrounding it.
The backend should at least be using the source file of the position, not the compilation unit, to compute the linenumber from offset, and ideally it should allow to hook-in customisations that allow for corrections such as "positionInUltimateSource"
here is the relevant line in BCodeSkelBuilder.
https://github.com/dotty-staging/dotty/blob/07f729e4322be097d54d4092420806ccf36b5f05/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala#L625-L626
Expectation
Follow Scala 2, which does this