FIR: copy class supertypes list on iterating while calculating supertypes

This list is backed by mutable list and during iterating on it
we can resolve supertypes of that class via IDE light classes
as IJ Java resolve may resolve a lot of stuff by fir light classes
This causes ConcurrentModificationException
This commit is contained in:
Ilya Kirillov
2021-01-11 22:18:44 +01:00
parent a0ad85e20d
commit 11a3126c8c
@@ -282,7 +282,7 @@ private class FirSupertypeResolverVisitor(
supertypeRefs: List<FirTypeRef>
): List<FirTypeRef> {
return resolveSpecificClassLikeSupertypes(classLikeDeclaration) { transformer, scope ->
supertypeRefs.mapTo(mutableListOf()) {
ArrayList(supertypeRefs).mapTo(mutableListOf()) {
val superTypeRef = transformer.transformTypeRef(it, scope).single
if (superTypeRef.coneTypeSafe<ConeTypeParameterType>() != null)