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:
Mikhail Zarechenskiy
2017-04-11 16:25:18 +03:00
parent 44170f3357
commit e86d52b681
16 changed files with 202 additions and 108 deletions
@@ -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()
}
@@ -0,0 +1,18 @@
package
private val propOfAnonObject: propOfAnonObject.<no name provided>
private fun createAnonObject(): createAnonObject.<no name provided>
public fun useAnonObject(): kotlin.Unit
public interface IBar {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface IFoo {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}