Support access to protected members within inline functions
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import test.*
|
||||
|
||||
class A: P() {
|
||||
override val FOO: String
|
||||
get() = "fail"
|
||||
|
||||
override fun test(): String {
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val p = P()
|
||||
return p.protectedProp() + p.protectedFun()
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
open class P {
|
||||
protected open val FOO = "O"
|
||||
|
||||
protected open fun test() = "K"
|
||||
|
||||
inline fun protectedProp(): String {
|
||||
return FOO
|
||||
}
|
||||
|
||||
inline fun protectedFun(): String {
|
||||
return test()
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import test.*
|
||||
|
||||
class A: P() {
|
||||
override val FOO: String
|
||||
get() = "fail"
|
||||
|
||||
override fun test(): String {
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val p = P()
|
||||
return p.protectedProp() + p.protectedFun()
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
open class Base {
|
||||
protected open val FOO = "O"
|
||||
|
||||
protected open fun test() = "K"
|
||||
}
|
||||
|
||||
open class P : Base() {
|
||||
|
||||
inline fun protectedProp(): String {
|
||||
return FOO
|
||||
}
|
||||
|
||||
inline fun protectedFun(): String {
|
||||
return test()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user