KT-13025: when receiver of call of 'invoke' method is a Function, check whether receiver is an extension function and generate additional '.call' invocation. Fix #KT-13025

This commit is contained in:
Alexey Andreev
2016-07-12 16:34:09 +03:00
parent c767b3d0ac
commit df86840515
3 changed files with 29 additions and 1 deletions
@@ -0,0 +1,16 @@
package foo
class A(val f: (B.() -> Int)?)
class B(val x: Int)
fun test(g: (B.() -> Int)?): Int? {
val a = A(g)
val b = B(2)
return a.f?.invoke(b)
}
fun box(): String {
assertEquals(5, test { x + 3 })
return "OK"
}