Don't delete nested default lambda classes during inline transformation

(cherry picked from commit 50608d0)
This commit is contained in:
Mikhael Bogdanov
2017-12-21 10:04:02 +01:00
parent 1a6fb37c45
commit 108e1c2d1c
14 changed files with 350 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
package test
interface Call {
fun run(): String
}
inline fun test(s: () -> Call = {
object : Call {
override fun run() = "OK"
} as Call
}) = s()
val same = test()
// FILE: 2.kt
import test.*
fun box(): String {
val inlined = test()
if (same.run() != "OK") return "fail 1: ${same.run()}"
return inlined.run()
}