Files
kotlin/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt
Mikhail Zarechenskiy e86d52b681 Fix return type of private members that return anonymous object
#KT-16813 Fixed

Anonymous objects returned from private-in-file members should behave as for private class members
2017-04-17 16:21:05 +03:00

24 lines
442 B
Kotlin
Vendored

interface IFoo {
fun foo()
}
interface IBar
private fun createAnonObject() =
object : IFoo, IBar {
override fun foo() {}
fun qux() {}
}
private val propOfAnonObject = object : IFoo, IBar {
override fun foo() {}
fun qux() {}
}
fun useAnonObject() {
createAnonObject().foo()
createAnonObject().qux()
propOfAnonObject.foo()
propOfAnonObject.qux()
}