1st test for traits work

This commit is contained in:
Alex Tkachman
2011-09-12 09:26:50 +03:00
parent 24dc0fd11e
commit 60ab760d4a
14 changed files with 174 additions and 43 deletions
+12
View File
@@ -0,0 +1,12 @@
trait SimpleClass : java.lang.Object {
fun foo() : String = "239 " + toString ()
}
class SimpleClassImpl() : SimpleClass {
override fun toString() = "SimpleClassImpl"
}
fun box() : String {
val c = SimpleClassImpl()
return if("239 SimpleClassImpl" == c.foo()) "OK" else "fail"
}