Support access to companion private members from nested classes
#KT-5363 Fixed #KT-6804 Fixed
This commit is contained in:
committed by
Max Kammerer
parent
3d88df73e0
commit
d977d29ec4
@@ -0,0 +1,13 @@
|
||||
class Outer {
|
||||
class Nested{
|
||||
fun foo(s: String) = s.extension()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun String.extension(): String = this
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Outer.Nested().foo("OK")
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Outer {
|
||||
class Nested {
|
||||
fun fn() = s
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val s = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return Outer.Nested().fn()
|
||||
}
|
||||
Reference in New Issue
Block a user