Fix race in IDE: inject proper storage manager for type parameters
With NO_LOCKS strategy we can easily end up in a situation when constraint system for a generic call is built incorrectly, producing flaky errors (or don't produce errors at all) Now proper storage manager is injected for all cases except: - IR - Codegen - Serialization plugin - Fake local objects Most likely, NO_LOCKS strategy for these cases is fine as at that point the compiler works in one thread #KT-34786 Fixed
This commit is contained in:
+3
-3
@@ -21,8 +21,6 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
|
||||
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import java.util.*
|
||||
|
||||
open class AbstractAccessorForFunctionDescriptor(
|
||||
containingDeclaration: DeclarationDescriptor,
|
||||
@@ -34,7 +32,9 @@ open class AbstractAccessorForFunctionDescriptor(
|
||||
val copy = TypeParameterDescriptorImpl.createForFurtherModification(
|
||||
this, it.annotations, it.isReified,
|
||||
it.variance, it.name,
|
||||
it.index, SourceElement.NO_SOURCE)
|
||||
it.index, SourceElement.NO_SOURCE,
|
||||
it.storageManager
|
||||
)
|
||||
for (upperBound in it.upperBounds) {
|
||||
copy.addUpperBound(upperBound)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ fun CallableMemberDescriptor.createTypeParameterWithNewName(
|
||||
descriptor.variance,
|
||||
Name.identifier(newName),
|
||||
descriptor.index,
|
||||
descriptor.source
|
||||
descriptor.source,
|
||||
descriptor.storageManager
|
||||
)
|
||||
descriptor.upperBounds.forEach {
|
||||
newDescriptor.addUpperBound(it)
|
||||
|
||||
Reference in New Issue
Block a user