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:
+5
@@ -190,6 +190,11 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/functionDeclaration.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionWithBodyExpression.kt")
|
||||
public void testFunctionWithBodyExpression() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/functionWithBodyExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericCrossinlineArgument.kt")
|
||||
public void testGenericCrossinlineArgument() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/genericCrossinlineArgument.kt");
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package functionWithBodyExpression
|
||||
|
||||
fun main() {
|
||||
//Breakpoint!
|
||||
val a = 5
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun f2() = "f2"
|
||||
f2()
|
||||
|
||||
// RESULT: "f2": Ljava/lang/String;
|
||||
+11
@@ -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
|
||||
Reference in New Issue
Block a user