Projections & Initial grammar
This commit is contained in:
@@ -2,16 +2,16 @@ interface class IIterator<out T> {
|
||||
fun next() : T
|
||||
val hasNext : Boolean
|
||||
|
||||
fun toArray(buffer : WriteOnlyArray<T>) : Int { // T is still an in-parameter
|
||||
fun toArray(buffer : MutableArray<in T>) : Int { // T is still an in-parameter
|
||||
return fillBuffer(buffer, 0, buffer.size)
|
||||
}
|
||||
|
||||
fun toArray(buffer : WriteOnlyArray<T>, from : Int, length : Int) : Int { // T is still an in-parameter
|
||||
fun toArray(buffer : MutableArray<in T>, from : Int, length : Int) : Int { // T is still an in-parameter
|
||||
if (from < 0 || from > buffer.lastIndex || length < 0 || length > buffer.size - from) {
|
||||
throw IndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
if (len == 0) return 0;
|
||||
if (len == 0) return 0
|
||||
|
||||
var count = 0;
|
||||
for (i in [from .. from + length - 1]) {
|
||||
|
||||
Reference in New Issue
Block a user