Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt860.kt
T
Alexander Udalov 0d76634f6b Support SKIP_TXT directive in diagnostic tests
Don't render the whole 'kotlin' package in some tests, because test data will
change every time something is updated in built-ins
2015-04-29 01:36:20 +03:00

15 lines
330 B
Kotlin
Vendored

// !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>())