Support bound callable references in codegen

This commit is contained in:
Alexander Udalov
2016-04-29 21:59:27 +03:00
parent 526a64dc36
commit b9e61f035f
13 changed files with 242 additions and 65 deletions
@@ -0,0 +1,5 @@
inline fun foo(x: () -> String) = x()
fun String.id() = this
fun box() = foo("OK"::id)
@@ -0,0 +1,4 @@
fun box(): String {
val f = "KOTLIN"::get
return "${f(1)}${f(0)}"
}
@@ -0,0 +1,5 @@
fun box(): String {
val f = "kotlin"::length
val result = f.get()
return if (result == 6) "OK" else "Fail: $result"
}