Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt860.kt
T

16 lines
347 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -NOTHING_TO_INLINE
// KT-860 ConcurrentModificationException in frontend
package std.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>())