Public members should have bigger priority in debugContext

#KT-10634 Fixed
This commit is contained in:
Natalia Ukhorskaya
2016-01-28 15:11:15 +03:00
parent d60a5e65c1
commit b19d32e4f2
5 changed files with 102 additions and 14 deletions
@@ -0,0 +1,47 @@
package privateMembersPriority
fun main(args: Array<String>) {
Receiver2().test1()
test2()
test3()
}
class Receiver1 {
private fun privateFun() = 1
}
class Receiver2 {
fun privateFun() = 2
// In IDE -> privateFun() will return 2, because privateFun from Receiver is invisible in current scope
fun test1() {
with(Receiver1()) {
// EXPRESSION: privateFun()
// RESULT: 1: I
//Breakpoint!
privateFun()
}
}
}
// In debuggerContext there are two properties size in ArrayList (java field + kotlin property)
fun test2() {
val javaClass = arrayListOf(1)
// EXPRESSION: javaClass.size
// RESULT: 1: I
//Breakpoint!
javaClass.size
}
fun test3() {
// EXPRESSION: TwoPrivateFun().foo(1)
// RESULT: 1: I
//Breakpoint!
val a = 1
}
class TwoPrivateFun {
private fun foo(i: Int) = 1
private fun foo(i: Double) = 2
}