Fix for KT-10137: Internal error: couldn't inline method call on lambda taking extension function parameter

#KT-10137 Fixed
This commit is contained in:
Michael Bogdanov
2015-11-24 12:46:04 +03:00
parent a19bdaeb23
commit 3da463be27
10 changed files with 129 additions and 3 deletions
@@ -0,0 +1,10 @@
import test.*
fun box(): String {
var result = "fail"
W("OK").safe {
result = this as String
}
return result
}
@@ -0,0 +1,10 @@
package test
class W(val value: Any)
inline fun W.safe(crossinline body : Any.() -> Unit) {
{
this.value?.body()
}()
}
@@ -0,0 +1,12 @@
import test.*
fun box(): String {
var result = "fail"
W("OK").safe {
{
result = this as String
}()
}
return result
}
@@ -0,0 +1,10 @@
package test
class W(val value: Any)
inline fun W.safe(crossinline body : Any.() -> Unit) {
{
this.value?.body()
}()
}