Evaluator: New implementation for variable finder

Support both old and new receiver variable conventions in variable finder.
This commit is contained in:
Yan Zhulanow
2018-12-07 19:56:30 +09:00
parent df7bbf707b
commit 5c419fc629
13 changed files with 514 additions and 439 deletions
@@ -41,11 +41,9 @@ Compile bytecode for extClass.testCompPrivate()
extensionMemberFunction.kt:88
Compile bytecode for testCompPrivate()
extensionMemberFunction.kt:98
Compile bytecode for testCompPublic()
extensionMemberFunction.kt:103
Compile bytecode for this.testCompPublic()
extensionMemberFunction.kt:108
Compile bytecode for testCompPrivate()
extensionMemberFunction.kt:113
Compile bytecode for this.testCompPrivate()
Disconnected from the target VM
@@ -41,11 +41,9 @@ Compile bytecode for extClass.testCompPrivate
extensionMemberProperty.kt:92
Compile bytecode for testCompPrivate
extensionMemberProperty.kt:102
Compile bytecode for testCompPublic
extensionMemberProperty.kt:107
Compile bytecode for this.testCompPublic
extensionMemberProperty.kt:112
Compile bytecode for testCompPrivate
extensionMemberProperty.kt:117
Compile bytecode for this.testCompPrivate
Disconnected from the target VM
@@ -23,7 +23,7 @@ class Outer {
// outer isn't captured in lambda
lambda {
// EXPRESSION: foo() + 2
// RESULT: java.lang.AssertionError : Cannot find local variable: name = this
// RESULT: java.lang.AssertionError : Cannot find local variable: name = 'this@Outer', type = funFromOuterClassInLamdba.Outer
//Breakpoint!
val a = 1
}
@@ -16,7 +16,7 @@ fun main(args: Array<String>) {
fun myLocalFun3() {
// EXPRESSION: myLocalFun1() + 1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = myLocalFun1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = 'myLocalFun1', type = kotlin.jvm.functions.Function0
//Breakpoint!
myLocalFun1() + 1
}
@@ -56,7 +56,7 @@ fun main(args: Array<String>) {
i = 1
fun myLocalFun7() {
// EXPRESSION: myLocalFun6() + 1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = myLocalFun6
// RESULT: java.lang.AssertionError : Cannot find local variable: name = 'myLocalFun6', type = kotlin.jvm.functions.Function0
//Breakpoint!
myLocalFun6() + 1
}
@@ -15,4 +15,4 @@ fun foo(f: () -> Unit) {
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = val1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = 'val1', type = int
@@ -20,7 +20,7 @@ fun foo(f: () -> Unit) {
// PRINT_FRAME
// EXPRESSION: val1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = val1
// RESULT: java.lang.AssertionError : Cannot find local variable: name = 'val1', type = int
frame = invoke:7, FrameLambdaNotUsedKt$main$1 {frameLambdaNotUsed}
this = this = {frameLambdaNotUsed.FrameLambdaNotUsedKt$main$1@uniqueID}Function0<kotlin.Unit>
field = arity: int = 0 (sp = Lambda.!EXT!)