KT-860 ConcurrentModificationException in frontend

This commit is contained in:
Andrey Breslav
2011-12-20 14:21:45 +04:00
parent 78a2845604
commit 4d4a45f79a
2 changed files with 15 additions and 1 deletions
@@ -259,7 +259,7 @@ public class ConstraintSystemWithPriorities implements ConstraintSystem {
assert constraintQueue.isEmpty() || unsolvedUnknowns.isEmpty() : constraintQueue + " " + unsolvedUnknowns;
for (TypeValue unknown : unsolvedUnknowns) {
for (TypeValue unknown : Sets.newLinkedHashSet(unsolvedUnknowns)) {
if (!computeValueFor(unknown)) {
listener.error("Not enough data to compute value for ", unknown);
solution.registerError("Not enough data to compute value for " + unknown + ". Please, specify type arguments explicitly");
@@ -0,0 +1,14 @@
// KT-860 ConcurrentModificationException in frontend
// +JDK
namespace std.util
import java.util.*
fun <T, U: Collection<in T>> Iterator<T>.to(container: U) : U {
while(hasNext)
container.add(next())
return container
}
inline fun <T> Iterator<T>.toArrayList() = to(ArrayList<T>())