Evaluate: Support synthetic 'field' variable evaluation (KT-28342)
This commit is contained in:
+27
@@ -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
|
||||
+11
@@ -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
|
||||
Reference in New Issue
Block a user