Fix exception from InvokeProcessor when we get invoke from extension function type.

This commit is contained in:
Stanislav Erokhin
2015-12-11 13:55:59 +03:00
parent 616bb444ec
commit 39b6637c7c
4 changed files with 45 additions and 6 deletions
@@ -0,0 +1,23 @@
class A(val x: (String.() -> Unit)?)
fun test(a: A) {
if (a.x != null) {
"".<!DEBUG_INFO_SMARTCAST!>(a.x)<!>()
a.<!UNSAFE_CALL!>x<!>("") // todo
<!DEBUG_INFO_SMARTCAST!>(a.x)<!>("")
}
"".<!UNSAFE_CALL!>(a.x)<!>()
a.<!UNSAFE_CALL!>x<!>("")
<!UNSAFE_CALL!>(a.x)<!>("")
with("") {
a.<!UNSAFE_CALL!>x<!>(<!NO_VALUE_FOR_PARAMETER!>)<!>
<!UNSAFE_CALL!>(a.x)<!>()
if (a.x != null) {
a.<!UNSAFE_CALL!>x<!>(<!NO_VALUE_FOR_PARAMETER!>)<!> // todo
<!DEBUG_INFO_SMARTCAST!>(a.x)<!>()
}
}
}
fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()