Fix for KT-13040: Invalid bytecode generated for extension lambda invocation with safe call

#KT-13040 Fixed
This commit is contained in:
Michael Bogdanov
2016-07-08 20:31:23 +03:00
parent 93f6761671
commit 23a0e19620
5 changed files with 63 additions and 1 deletions
@@ -0,0 +1,19 @@
// FILE: 1.kt
package test
public inline fun <T> with2(receiver: T, body: T.() -> String) = receiver.body()
// FILE: 2.kt
import test.*
fun <T : Any> test(item: T?, defaultLink: T.() -> String): String {
return with2("") {
item?.defaultLink() ?: "fail"
}
}
fun box(): String {
return test("O") {
this + "K"
}
}
@@ -0,0 +1,19 @@
// FILE: 1.kt
package test
public inline fun <T> with2(receiver: T, body: T.() -> String) = receiver.body()
// FILE: 2.kt
import test.*
inline fun <T : Any> test(item: T?, defaultLink: T.() -> String): String {
return with2("") {
item?.defaultLink() ?: "fail"
}
}
fun box(): String {
return test("O") {
this + "K"
}
}