Added static checks for properties in traits; more tests for 'abstract'

This commit is contained in:
svtk
2011-09-12 16:01:48 +04:00
parent 60ab760d4a
commit 4071d67c41
7 changed files with 347 additions and 108 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ class StrangeIterateeImpl<in I, out O>(val obj: O) : Iteratee<I, O> {
override fun process(item: I): Iteratee<I, O> = StrangeIterateeImpl<I, O>(obj)
override val isDone = true
override val result = obj
override val done = obj
override fun done() = obj
}
abstract class Sum() : Iteratee<Int, Int> {
@@ -51,7 +51,7 @@ abstract class Sum() : Iteratee<Int, Int> {
abstract override fun done() : Int
}
class Collection<E> : Iterable<E> {
abstract class Collection<E> : Iterable<E> {
fun iterate<O>(iteratee : Iteratee<E, O>) : O {
for (x in this) {
val it = iteratee.process(x)