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
Currently the line numbers of method invocations in the bytecode uses the last parameter as the line of the call. This is useful to save an extra label and line number in the bytecode and avoid jumping back while debugging.
Unfortunately if the last argument happens to be inlined from somewhere else, the call also inherits this line number.
objectTest {
inlinedeffun[T](inlinetag: String):Unit= {
printStack(
tag,
"track"// line 6
)
printStack(
"track",
tag // line 10
)
}
defprintStack(tag1: String, tag2: String):Unit= {
println(s"$tag1$tag2: ${newException().getStackTrace().apply(1)}")
}
defmain(args: Array[String]):Unit= {
fun(
"abc"// line 20
)
}
}
Note: this only hapend on top of #6066 which fixes the positions of inlined arguments with singleton types. Before the buggy position happend to negate it self with this bug.
Possible solutions:
Use the end line of the position of theApply/TypeApply as position of invocation
For every invocation: would increse bytecode size of every multiline call
Only if the position of the last argument if not contained in the position of the call
Loose all inline positions: we already have to do it for all inline code that comes from another file. The position of the call is used for all inlined trees.
The text was updated successfully, but these errors were encountered:
Loose all inline positions: we already have to do it for all inline code that comes from another file. The position of the call is used for all inlined trees.
That would give terrible backtraces and make it impossible to debug code that's wrapped in trace in dotty.
This is only for code the is inlined from the same file. The code for trace will have all its positions removed. We cannot do better because we can only emit line numbers but no source files.
This issue is only about those few cases where the inlined method is in the same file.
Currently the line numbers of method invocations in the bytecode uses the last parameter as the line of the call. This is useful to save an extra label and line number in the bytecode and avoid jumping back while debugging.
Unfortunately if the last argument happens to be inlined from somewhere else, the call also inherits this line number.
Note: this only hapend on top of #6066 which fixes the positions of inlined arguments with singleton types. Before the buggy position happend to negate it self with this bug.
Possible solutions:
Apply/TypeApply
as position of invocationThe text was updated successfully, but these errors were encountered: