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
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user