-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Inline methods with by-name arguments break debugging information #4947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@odersky can you take a look? |
The same issue happens at runtime with the stack trace object Foo {
transparent def track[T](f: => T): T = f
def main(args: Array[String]): Unit = {
track {
val a = 9
???
}
}
}
|
@nicolasstucki That's a separate (and much harder to solve) issue, if your code is inlined in a method, you can't have the stacktrace show the methods that have been inlined. JSR-45 (that the Scala Center was supposed to implement) should help in theory but I don't think it's used for stacktraces. |
Actually JSR-45 is relevant for the original issue from @Blaisorblade too: without implementing it, there is no way to preserve line information for debugging when inlining across files. |
No, in this case we lose the position of code that was in the current method (not inlined code). The position of the tree of |
The position is changed in erasure when the |
Fix #4947: Do not replace positions of inlined arguments
In the snippet below, setting breakpoints in
isSubType
is hard if it's compiled by Dotty, because all of isSubType appears written on line 100.Probably should be addressed before bootstrap, hence tentatively targeting milestone 0.10.
The text was updated successfully, but these errors were encountered: