Add some new tests on functions and extension functions

This commit is contained in:
Alexander Udalov
2015-05-26 18:20:33 +03:00
parent fae2d0231c
commit 6ae7ed1cc4
10 changed files with 88 additions and 0 deletions
@@ -0,0 +1,11 @@
fun box(): String {
val f = fun (s: String): String = s
val g = f as String.() -> String
if ("OK".g() != "OK") return "Fail 1"
val h = fun String.(): String = this
val i = h as (String) -> String
if (i("OK") != "OK") return "Fail 2"
return "OK"
}