Debugger: Allow to evaluate private properties from companion objects (KT-26795)
This commit is contained in:
+42
@@ -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
|
||||
+13
@@ -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
|
||||
Reference in New Issue
Block a user