[FIR] Add workaround for exception in JavaOverrideChecker.buildErasure
- `useMutableOrEmpty` causes the bounds to be replaced atomically, which avoids the race described in KT-60324. ^KT-60324 fixed ^KT-60445
This commit is contained in:
committed by
Space Team
parent
73032213f0
commit
85c4d6b67b
+1
-1
@@ -52,7 +52,7 @@ class FirTypeParameterBuilder : FirAnnotationContainerBuilder {
|
||||
containingDeclarationSymbol,
|
||||
variance,
|
||||
isReified,
|
||||
bounds,
|
||||
bounds.toMutableOrEmpty(),
|
||||
annotations.toMutableOrEmpty(),
|
||||
)
|
||||
}
|
||||
|
||||
+2
-3
@@ -37,7 +37,7 @@ internal class FirTypeParameterImpl(
|
||||
override val containingDeclarationSymbol: FirBasedSymbol<*>,
|
||||
override val variance: Variance,
|
||||
override val isReified: Boolean,
|
||||
override val bounds: MutableList<FirTypeRef>,
|
||||
override var bounds: MutableOrEmptyList<FirTypeRef>,
|
||||
override var annotations: MutableOrEmptyList<FirAnnotation>,
|
||||
) : FirTypeParameter() {
|
||||
|
||||
@@ -63,8 +63,7 @@ internal class FirTypeParameterImpl(
|
||||
}
|
||||
|
||||
override fun replaceBounds(newBounds: List<FirTypeRef>) {
|
||||
bounds.clear()
|
||||
bounds.addAll(newBounds)
|
||||
bounds = newBounds.toMutableOrEmpty()
|
||||
}
|
||||
|
||||
override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
|
||||
|
||||
+2
-1
@@ -345,7 +345,8 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
}
|
||||
+field(varianceType)
|
||||
+booleanField("isReified")
|
||||
+fieldList("bounds", typeRef, withReplace = true)
|
||||
// TODO: `useMutableOrEmpty = true` is a workaround for KT-60324 until KT-60445 has been fixed.
|
||||
+fieldList("bounds", typeRef, withReplace = true, useMutableOrEmpty = true)
|
||||
+annotations
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user