Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt860.kt
T
Mikhael Bogdanov d11311ec20 Test compilation fix
2013-12-02 18:30:42 +04:00

15 lines
333 B
Kotlin

// !DIAGNOSTICS: -NOTHING_TO_INLINE
// KT-860 ConcurrentModificationException in frontend
package kotlin.util
import java.util.*
fun <T, U: MutableCollection<in T>> Iterator<T>.to(container: U) : U {
while(hasNext())
container.add(next())
return container
}
fun <T> Iterator<T>.toArrayList() = to(ArrayList<T>())