Fix evaluation for captured inline classes (KT-28487)
This commit is contained in:
+2
-1
@@ -324,7 +324,8 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, val sourcePosition: Sour
|
|||||||
|
|
||||||
ClassReader(mainClassBytecode).accept(object : ClassVisitor(ASM5) {
|
ClassReader(mainClassBytecode).accept(object : ClassVisitor(ASM5) {
|
||||||
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
|
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
|
||||||
if (name == GENERATED_FUNCTION_NAME) {
|
// Maybe just take the single method from the class, as it is done in 'evaluateWithCompilation'
|
||||||
|
if (name == GENERATED_FUNCTION_NAME || name.startsWith(GENERATED_FUNCTION_NAME + "-")) {
|
||||||
val argumentTypes = Type.getArgumentTypes(desc)
|
val argumentTypes = Type.getArgumentTypes(desc)
|
||||||
val args = context.getArgumentsForEval4j(compiledData.parameters, argumentTypes)
|
val args = context.getArgumentsForEval4j(compiledData.parameters, argumentTypes)
|
||||||
|
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package inlineMethodsInSignature
|
||||||
|
|
||||||
|
inline class InlineMe(val x: Int)
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val i = InlineMe(1)
|
||||||
|
//Breakpoint!
|
||||||
|
println()
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPRESSION: i
|
||||||
|
// RESULT: 1: I
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
LineBreakpoint created at inlineMethodsInSignature.kt:8
|
||||||
|
Run Java
|
||||||
|
Connected to the target VM
|
||||||
|
inlineMethodsInSignature.kt:8
|
||||||
|
Compile bytecode for i
|
||||||
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
|
|
||||||
Generated
+5
@@ -186,6 +186,11 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
|
|||||||
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointVariants.kt");
|
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointVariants.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineMethodsInSignature.kt")
|
||||||
|
public void testInlineMethodsInSignature() throws Exception {
|
||||||
|
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineMethodsInSignature.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("innerClass.kt")
|
@TestMetadata("innerClass.kt")
|
||||||
public void testInnerClass() throws Exception {
|
public void testInnerClass() throws Exception {
|
||||||
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/innerClass.kt");
|
runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/innerClass.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user