Debugger: Allow to evaluate private properties from companion objects (KT-26795)

This commit is contained in:
Yan Zhulanow
2018-09-17 21:24:30 +03:00
parent fee0cfcecb
commit 713dc589e0
5 changed files with 62 additions and 2 deletions
@@ -0,0 +1,42 @@
package privateFieldInCompanion
class Foo {
companion object {
private const val PRIVATE_CONST = 1
const val PUBLIC_CONST = 2
private val PRIVATE_VAL = 3
val PUBLIC_VAL = 4
private val PRIVATE_STATIC = 5
val PUBLIC_STATIC = 6
}
fun foo() {
//Breakpoint!
val a = 5
}
}
fun main(args: Array<String>) {
Foo().foo()
}
// EXPRESSION: PRIVATE_CONST
// RESULT: 1: I
// EXPRESSION: PUBLIC_CONST
// RESULT: 2: I
// EXPRESSION: PRIVATE_VAL
// RESULT: 3: I
// EXPRESSION: PUBLIC_VAL
// RESULT: 4: I
// EXPRESSION: PRIVATE_STATIC
// RESULT: 5: I
// EXPRESSION: PUBLIC_STATIC
// RESULT: 6: I
@@ -0,0 +1,13 @@
LineBreakpoint created at privateFieldInCompanion.kt:18
Run Java
Connected to the target VM
privateFieldInCompanion.kt:18
Compile bytecode for PRIVATE_CONST
Compile bytecode for PUBLIC_CONST
Compile bytecode for PRIVATE_VAL
Compile bytecode for PUBLIC_VAL
Compile bytecode for PRIVATE_STATIC
Compile bytecode for PUBLIC_STATIC
Disconnected from the target VM
Process finished with exit code 0