Fix for KT-13374: CompilationException: Inline function call with anonymous object implementing an interface by delegation

#KT-13374 Fixed
This commit is contained in:
Michael Bogdanov
2016-08-15 14:46:58 +03:00
parent fca5834557
commit 7325baa06a
8 changed files with 57 additions and 7 deletions
@@ -0,0 +1,37 @@
// FILE: 1.kt
package test
interface IZ {
fun z()
}
interface IZZ : IZ {
fun zz()
}
inline fun implZZ(zImpl: IZ, crossinline zzImpl: () -> Unit): IZZ =
object : IZZ, IZ by zImpl {
override fun zz() = zzImpl()
}
// FILE: 2.kt
import test.*
var result = "fail";
object ZImpl : IZ {
override fun z() {
result = "O"
}
}
fun box(): String {
val zz = implZZ(ZImpl) { result += "K" }
zz.z()
zz.zz()
return result
}