Don't delete nested default lambda classes during inline transformation
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun test(p: String, s: () -> () -> String = { { p } }) =
|
||||
s()
|
||||
|
||||
val same = test("O")
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val inlined = test("K")
|
||||
return same() + inlined()
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun test(p: String, s: () -> () -> () -> String = { { { p } } }) =
|
||||
s()
|
||||
|
||||
val same = test("O")
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val inlined = test("K")
|
||||
return same()() + inlined()()
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
interface Call {
|
||||
fun run(): String
|
||||
}
|
||||
|
||||
inline fun test(p: String, s: () -> Call = {
|
||||
object : Call {
|
||||
override fun run() = p
|
||||
} as Call
|
||||
}) = s()
|
||||
|
||||
val same = test("O")
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val inlined = test("K")
|
||||
return same.run() + inlined.run()
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun test(s: () -> () -> String = { { "OK" } }) =
|
||||
s()
|
||||
|
||||
val same = test()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val inlined = test()
|
||||
if (same() != "OK") return "fail 1: ${same()}"
|
||||
return inlined()
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun test(s: () -> () -> () -> String = { { { "OK" } } }) =
|
||||
s()
|
||||
|
||||
val same = test()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val inlined = test()
|
||||
if (same()() != "OK") return "fail 1: ${same()()}"
|
||||
return inlined()()
|
||||
}
|
||||
Vendored
+25
@@ -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()
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun <T> test(p: T, s: () -> () -> T = { { p } }) =
|
||||
s()
|
||||
|
||||
val same = test("O")
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val inlined = test("K")
|
||||
return same() + inlined()
|
||||
}
|
||||
Reference in New Issue
Block a user