You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
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
see https://github.com/scala/scala/blame/ceda7ea5a42168eacf4fe9b70f6e08e1684bbfda/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala#L498
The text was updated successfully, but these errors were encountered: