Evaluate: Support synthetic 'field' variable evaluation (KT-28342)

This commit is contained in:
Yan Zhulanow
2018-11-26 17:29:32 +09:00
parent 60d2490c45
commit c88d8a5e0d
6 changed files with 99 additions and 14 deletions
@@ -0,0 +1,27 @@
package fieldVariable
class Foo {
val a: String? = "field"
get() {
//Breakpoint!
val a = 5
return "not a " + field
}
val b: String?
get() {
//Breakpoint!
return "b"
}
}
fun main() {
Foo().a
Foo().b
}
// EXPRESSION: field
// RESULT: "field": Ljava/lang/String;
// EXPRESSION: field
// RESULT: Can't find a backing field for property field
@@ -0,0 +1,11 @@
LineBreakpoint created at fieldVariable.kt:7
LineBreakpoint created at fieldVariable.kt:14
Run Java
Connected to the target VM
fieldVariable.kt:7
Compile bytecode for field
fieldVariable.kt:14
Compile bytecode for field
Disconnected from the target VM
Process finished with exit code 0