Remove "Iterator.iterator()" intrinsic, add stdlib function

This commit is contained in:
Alexander Udalov
2014-02-21 21:20:35 +04:00
parent 4a5823c5bb
commit 11cc7f46f4
11 changed files with 29 additions and 99 deletions
+5
View File
@@ -4,6 +4,11 @@ import kotlin.support.*
import java.util.Collections
import kotlin.test.assertTrue
/**
* Returns the given iterator itself. This allows to use an instance of iterator in a ranged for-loop
*/
public fun <T> Iterator<T>.iterator(): Iterator<T> = this
/**
* Returns an iterator which invokes the function to calculate the next value on each iteration until the function returns *null*
*/