Initial implementation of platformStatic

This commit is contained in:
Michael Bogdanov
2014-09-01 15:12:31 +04:00
parent 7bbedd9685
commit e26d635633
36 changed files with 718 additions and 47 deletions
@@ -0,0 +1,38 @@
object A {
val b: String = "OK"
platformStatic fun test1() : String {
return b
}
platformStatic fun test2() : String {
return test1()
}
fun test3(): String {
return "1".test5()
}
platformStatic fun test4(): String {
return "1".test5()
}
platformStatic fun String.test5() : String {
return this + b
}
}
fun box(): String {
if (A.test1() != "OK") return "fail 1"
if (A.test2() != "OK") return "fail 2"
if (A.test3() != "1OK") return "fail 3"
if (A.test4() != "1OK") return "fail 4"
if (with(A) {"1".test5()} != "1OK") return "fail 5"
return "OK"
}