Added tests with SAM adapters in "invoke" convention.

This commit is contained in:
Evgeny Gerashchenko
2013-06-26 01:07:25 +04:00
parent f35390134f
commit 9905e2a719
5 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
class JavaClass {
void invoke(Runnable i) {
i.run();
}
}

View File

@@ -0,0 +1,8 @@
fun box(): String {
val obj = JavaClass()
var v = "FAIL"
obj({ v = "O" })
obj { v += "K" }
return v
}

View File

@@ -0,0 +1,6 @@
class JavaClass {
void invoke(Runnable p1, Runnable p2) {
p1.run();
p2.run();
}
}

View File

@@ -0,0 +1,7 @@
fun box(): String {
val obj = JavaClass()
var v = "FAIL"
obj({ v = "O" }, { v += "K" })
return v
}