Support access to companion private members from nested classes

#KT-5363 Fixed
  #KT-6804 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-19 13:15:48 +03:00
committed by Max Kammerer
parent 3d88df73e0
commit d977d29ec4
5 changed files with 59 additions and 2 deletions
+13
View File
@@ -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")
}
+13
View File
@@ -0,0 +1,13 @@
class Outer {
class Nested {
fun fn() = s
}
companion object {
private val s = "OK"
}
}
fun box(): String {
return Outer.Nested().fn()
}