Debugger: Fix evaluation of function declarations with expression bodies (KT-32704)

Before this commit, the substituted FunctionDescriptor didn't have a source element.
As a result, 'CodeFragmentParameterAnalyzer.isCodeFragmentDeclaration' failed to recognize such a descriptor as fragment-local, and it was erroneously captured.
This commit is contained in:
Yan Zhulanow
2019-10-10 21:30:10 +09:00
parent fa45122c6b
commit 87e0a2d98c
7 changed files with 36 additions and 5 deletions
@@ -0,0 +1,6 @@
package functionWithBodyExpression
fun main() {
//Breakpoint!
val a = 5
}
@@ -0,0 +1,4 @@
fun f2() = "f2"
f2()
// RESULT: "f2": Ljava/lang/String;
@@ -0,0 +1,11 @@
LineBreakpoint created at functionWithBodyExpression.kt:5
Run Java
Connected to the target VM
functionWithBodyExpression.kt:5
Compile bytecode for fun f2() = "f2"
f2()
// RESULT: "f2": Ljava/lang/String;
Disconnected from the target VM
Process finished with exit code 0