mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 00:21:28 +00:00
#KT-16813 Fixed Anonymous objects returned from private-in-file members should behave as for private class members
24 lines
442 B
Kotlin
Vendored
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()
|
|
} |