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.SimpleFunctionDescriptorImpl
|
||||||
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
open class AbstractAccessorForFunctionDescriptor(
|
open class AbstractAccessorForFunctionDescriptor(
|
||||||
containingDeclaration: DeclarationDescriptor,
|
containingDeclaration: DeclarationDescriptor,
|
||||||
@@ -34,7 +32,9 @@ open class AbstractAccessorForFunctionDescriptor(
|
|||||||
val copy = TypeParameterDescriptorImpl.createForFurtherModification(
|
val copy = TypeParameterDescriptorImpl.createForFurtherModification(
|
||||||
this, it.annotations, it.isReified,
|
this, it.annotations, it.isReified,
|
||||||
it.variance, it.name,
|
it.variance, it.name,
|
||||||
it.index, SourceElement.NO_SOURCE)
|
it.index, SourceElement.NO_SOURCE,
|
||||||
|
it.storageManager
|
||||||
|
)
|
||||||
for (upperBound in it.upperBounds) {
|
for (upperBound in it.upperBounds) {
|
||||||
copy.addUpperBound(upperBound)
|
copy.addUpperBound(upperBound)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ fun CallableMemberDescriptor.createTypeParameterWithNewName(
|
|||||||
descriptor.variance,
|
descriptor.variance,
|
||||||
Name.identifier(newName),
|
Name.identifier(newName),
|
||||||
descriptor.index,
|
descriptor.index,
|
||||||
descriptor.source
|
descriptor.source,
|
||||||
|
descriptor.storageManager
|
||||||
)
|
)
|
||||||
descriptor.upperBounds.forEach {
|
descriptor.upperBounds.forEach {
|
||||||
newDescriptor.addUpperBound(it)
|
newDescriptor.addUpperBound(it)
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ public class JavaResolverUtils {
|
|||||||
typeParameter.getVariance(),
|
typeParameter.getVariance(),
|
||||||
typeParameter.getName(),
|
typeParameter.getName(),
|
||||||
typeParameter.getIndex(),
|
typeParameter.getIndex(),
|
||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE,
|
||||||
|
typeParameter.getStorageManager()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -472,7 +472,8 @@ public class DescriptorResolver {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
supertypeLoopsResolver
|
supertypeLoopsResolver,
|
||||||
|
storageManager
|
||||||
);
|
);
|
||||||
trace.record(BindingContext.TYPE_PARAMETER, typeParameter, typeParameterDescriptor);
|
trace.record(BindingContext.TYPE_PARAMETER, typeParameter, typeParameterDescriptor);
|
||||||
return typeParameterDescriptor;
|
return typeParameterDescriptor;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
|||||||
import org.jetbrains.kotlin.utils.Printer
|
import org.jetbrains.kotlin.utils.Printer
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class DynamicCallableDescriptors(storageManager: StorageManager, builtIns: KotlinBuiltIns) {
|
class DynamicCallableDescriptors(private val storageManager: StorageManager, builtIns: KotlinBuiltIns) {
|
||||||
|
|
||||||
val dynamicType by storageManager.createLazyValue {
|
val dynamicType by storageManager.createLazyValue {
|
||||||
createDynamicType(builtIns)
|
createDynamicType(builtIns)
|
||||||
@@ -150,7 +150,8 @@ class DynamicCallableDescriptors(storageManager: StorageManager, builtIns: Kotli
|
|||||||
false,
|
false,
|
||||||
Variance.INVARIANT,
|
Variance.INVARIANT,
|
||||||
Name.identifier("T$index"),
|
Name.identifier("T$index"),
|
||||||
index
|
index,
|
||||||
|
storageManager
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -55,6 +55,7 @@ import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
|||||||
import org.jetbrains.kotlin.resolve.calls.util.CallMaker;
|
import org.jetbrains.kotlin.resolve.calls.util.CallMaker;
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.AnnotationsForResolveKt;
|
import org.jetbrains.kotlin.resolve.descriptorUtil.AnnotationsForResolveKt;
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
||||||
|
import org.jetbrains.kotlin.storage.StorageManager;
|
||||||
import org.jetbrains.kotlin.types.*;
|
import org.jetbrains.kotlin.types.*;
|
||||||
import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt;
|
import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt;
|
||||||
|
|
||||||
@@ -97,15 +98,18 @@ public class ControlStructureTypingUtils {
|
|||||||
private final CallResolver callResolver;
|
private final CallResolver callResolver;
|
||||||
private final DataFlowAnalyzer dataFlowAnalyzer;
|
private final DataFlowAnalyzer dataFlowAnalyzer;
|
||||||
private final ModuleDescriptor moduleDescriptor;
|
private final ModuleDescriptor moduleDescriptor;
|
||||||
|
private final StorageManager storageManager;
|
||||||
|
|
||||||
public ControlStructureTypingUtils(
|
public ControlStructureTypingUtils(
|
||||||
@NotNull CallResolver callResolver,
|
@NotNull CallResolver callResolver,
|
||||||
@NotNull DataFlowAnalyzer dataFlowAnalyzer,
|
@NotNull DataFlowAnalyzer dataFlowAnalyzer,
|
||||||
@NotNull ModuleDescriptor moduleDescriptor
|
@NotNull ModuleDescriptor moduleDescriptor,
|
||||||
|
@NotNull StorageManager storageManager
|
||||||
) {
|
) {
|
||||||
this.callResolver = callResolver;
|
this.callResolver = callResolver;
|
||||||
this.dataFlowAnalyzer = dataFlowAnalyzer;
|
this.dataFlowAnalyzer = dataFlowAnalyzer;
|
||||||
this.moduleDescriptor = moduleDescriptor;
|
this.moduleDescriptor = moduleDescriptor;
|
||||||
|
this.storageManager = storageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ ResolvedCall<FunctionDescriptor> resolveSpecialConstructionAsCall(
|
/*package*/ ResolvedCall<FunctionDescriptor> resolveSpecialConstructionAsCall(
|
||||||
@@ -202,7 +206,7 @@ public class ControlStructureTypingUtils {
|
|||||||
|
|
||||||
TypeParameterDescriptor typeParameter = TypeParameterDescriptorImpl.createWithDefaultBound(
|
TypeParameterDescriptor typeParameter = TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
function, Annotations.Companion.getEMPTY(), false, Variance.INVARIANT,
|
function, Annotations.Companion.getEMPTY(), false, Variance.INVARIANT,
|
||||||
construct.getSpecialTypeParameterName(), 0);
|
construct.getSpecialTypeParameterName(), 0, storageManager);
|
||||||
|
|
||||||
KotlinType type = typeParameter.getDefaultType();
|
KotlinType type = typeParameter.getDefaultType();
|
||||||
KotlinType nullableType = TypeUtils.makeNullable(type);
|
KotlinType nullableType = TypeUtils.makeNullable(type);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import org.jetbrains.kotlin.ir.util.SymbolTable
|
|||||||
import org.jetbrains.kotlin.ir.util.TypeTranslator
|
import org.jetbrains.kotlin.ir.util.TypeTranslator
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
|
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||||
import org.jetbrains.kotlin.types.*
|
import org.jetbrains.kotlin.types.*
|
||||||
|
|
||||||
class IrBuiltIns(
|
class IrBuiltIns(
|
||||||
@@ -91,7 +92,7 @@ class IrBuiltIns(
|
|||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE
|
||||||
).apply {
|
).apply {
|
||||||
typeParameterDescriptor = TypeParameterDescriptorImpl.createWithDefaultBound(
|
typeParameterDescriptor = TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
this, Annotations.EMPTY, true, Variance.INVARIANT, Name.identifier("T0"), 0
|
this, Annotations.EMPTY, true, Variance.INVARIANT, Name.identifier("T0"), 0, LockBasedStorageManager.NO_LOCKS
|
||||||
)
|
)
|
||||||
|
|
||||||
valueParameterDescriptor = ValueParameterDescriptorImpl(
|
valueParameterDescriptor = ValueParameterDescriptorImpl(
|
||||||
@@ -153,7 +154,8 @@ class IrBuiltIns(
|
|||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE
|
||||||
).apply {
|
).apply {
|
||||||
typeParameterDescriptor = TypeParameterDescriptorImpl.createForFurtherModification(
|
typeParameterDescriptor = TypeParameterDescriptorImpl.createForFurtherModification(
|
||||||
this, Annotations.EMPTY, false, Variance.INVARIANT, Name.identifier("T0"), 0, SourceElement.NO_SOURCE
|
this, Annotations.EMPTY, false, Variance.INVARIANT, Name.identifier("T0"),
|
||||||
|
0, SourceElement.NO_SOURCE, LockBasedStorageManager.NO_LOCKS
|
||||||
).apply {
|
).apply {
|
||||||
addUpperBound(any)
|
addUpperBound(any)
|
||||||
setInitialized()
|
setInitialized()
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ open class WrappedTypeParameterDescriptor(
|
|||||||
|
|
||||||
override fun getDefaultType() = _defaultType
|
override fun getDefaultType() = _defaultType
|
||||||
|
|
||||||
|
override fun getStorageManager() = LockBasedStorageManager.NO_LOCKS
|
||||||
|
|
||||||
override fun getContainingDeclaration() = (owner.parent as IrDeclaration).descriptor
|
override fun getContainingDeclaration() = (owner.parent as IrDeclaration).descriptor
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import org.jetbrains.kotlin.resolve.TypeResolver;
|
|||||||
import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil;
|
import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil;
|
||||||
import org.jetbrains.kotlin.resolve.scopes.*;
|
import org.jetbrains.kotlin.resolve.scopes.*;
|
||||||
import org.jetbrains.kotlin.resolve.scopes.utils.ScopeUtilsKt;
|
import org.jetbrains.kotlin.resolve.scopes.utils.ScopeUtilsKt;
|
||||||
|
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
|
||||||
import org.jetbrains.kotlin.test.ConfigurationKind;
|
import org.jetbrains.kotlin.test.ConfigurationKind;
|
||||||
import org.jetbrains.kotlin.test.DummyTraces;
|
import org.jetbrains.kotlin.test.DummyTraces;
|
||||||
import org.jetbrains.kotlin.test.KotlinTestWithEnvironment;
|
import org.jetbrains.kotlin.test.KotlinTestWithEnvironment;
|
||||||
@@ -77,7 +78,8 @@ public class TypeUnifierTest extends KotlinTestWithEnvironment {
|
|||||||
|
|
||||||
private TypeParameterDescriptor createTypeVariable(String name) {
|
private TypeParameterDescriptor createTypeVariable(String name) {
|
||||||
return TypeParameterDescriptorImpl.createWithDefaultBound(
|
return TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
module, Annotations.Companion.getEMPTY(), false, Variance.INVARIANT, Name.identifier(name), 0
|
module, Annotations.Companion.getEMPTY(), false, Variance.INVARIANT,
|
||||||
|
Name.identifier(name), 0, LockBasedStorageManager.NO_LOCKS
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ class FunctionClassDescriptor(
|
|||||||
|
|
||||||
fun typeParameter(variance: Variance, name: String) {
|
fun typeParameter(variance: Variance, name: String) {
|
||||||
result.add(TypeParameterDescriptorImpl.createWithDefaultBound(
|
result.add(TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
this@FunctionClassDescriptor, Annotations.EMPTY, false, variance, Name.identifier(name), result.size
|
this@FunctionClassDescriptor, Annotations.EMPTY, false, variance, Name.identifier(name), result.size, storageManager
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ private val FAKE_CONTINUATION_CLASS_DESCRIPTOR_EXPERIMENTAL =
|
|||||||
visibility = Visibilities.PUBLIC
|
visibility = Visibilities.PUBLIC
|
||||||
setTypeParameterDescriptors(
|
setTypeParameterDescriptors(
|
||||||
TypeParameterDescriptorImpl.createWithDefaultBound(
|
TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
this, Annotations.EMPTY, false, Variance.IN_VARIANCE, Name.identifier("T"), 0
|
this, Annotations.EMPTY, false, Variance.IN_VARIANCE, Name.identifier("T"), 0, LockBasedStorageManager.NO_LOCKS
|
||||||
).let(::listOf)
|
).let(::listOf)
|
||||||
)
|
)
|
||||||
createTypeConstructor()
|
createTypeConstructor()
|
||||||
@@ -47,7 +47,7 @@ private val FAKE_CONTINUATION_CLASS_DESCRIPTOR_RELEASE =
|
|||||||
visibility = Visibilities.PUBLIC
|
visibility = Visibilities.PUBLIC
|
||||||
setTypeParameterDescriptors(
|
setTypeParameterDescriptors(
|
||||||
TypeParameterDescriptorImpl.createWithDefaultBound(
|
TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
this, Annotations.EMPTY, false, Variance.IN_VARIANCE, Name.identifier("T"), 0
|
this, Annotations.EMPTY, false, Variance.IN_VARIANCE, Name.identifier("T"), 0, LockBasedStorageManager.NO_LOCKS
|
||||||
).let(::listOf)
|
).let(::listOf)
|
||||||
)
|
)
|
||||||
createTypeConstructor()
|
createTypeConstructor()
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
|||||||
) : ClassDescriptorBase(storageManager, container, name, SourceElement.NO_SOURCE, /* isExternal = */ false) {
|
) : ClassDescriptorBase(storageManager, container, name, SourceElement.NO_SOURCE, /* isExternal = */ false) {
|
||||||
private val typeParameters = (0 until numberOfDeclaredTypeParameters).map { index ->
|
private val typeParameters = (0 until numberOfDeclaredTypeParameters).map { index ->
|
||||||
TypeParameterDescriptorImpl.createWithDefaultBound(
|
TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
this, Annotations.EMPTY, false, Variance.INVARIANT, Name.identifier("T$index"), index
|
this, Annotations.EMPTY, false, Variance.INVARIANT, Name.identifier("T$index"), index, storageManager
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.descriptors;
|
package org.jetbrains.kotlin.descriptors;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.storage.StorageManager;
|
||||||
import org.jetbrains.kotlin.types.KotlinType;
|
import org.jetbrains.kotlin.types.KotlinType;
|
||||||
import org.jetbrains.kotlin.types.TypeConstructor;
|
import org.jetbrains.kotlin.types.TypeConstructor;
|
||||||
import org.jetbrains.kotlin.types.Variance;
|
import org.jetbrains.kotlin.types.Variance;
|
||||||
@@ -53,4 +54,7 @@ public interface TypeParameterDescriptor extends ClassifierDescriptor, TypeParam
|
|||||||
* 3. 'getTypeConstructor' is the same as for original declaration (at least in means of 'equals')
|
* 3. 'getTypeConstructor' is the same as for original declaration (at least in means of 'equals')
|
||||||
*/
|
*/
|
||||||
boolean isCapturedFromOuterDeclaration();
|
boolean isCapturedFromOuterDeclaration();
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
StorageManager getStorageManager();
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -42,6 +42,7 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip
|
|||||||
|
|
||||||
private final NotNullLazyValue<TypeConstructor> typeConstructor;
|
private final NotNullLazyValue<TypeConstructor> typeConstructor;
|
||||||
private final NotNullLazyValue<SimpleType> defaultType;
|
private final NotNullLazyValue<SimpleType> defaultType;
|
||||||
|
private final StorageManager storageManager;
|
||||||
|
|
||||||
protected AbstractTypeParameterDescriptor(
|
protected AbstractTypeParameterDescriptor(
|
||||||
@NotNull final StorageManager storageManager,
|
@NotNull final StorageManager storageManager,
|
||||||
@@ -82,6 +83,7 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.storageManager = storageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void reportSupertypeLoopError(@NotNull KotlinType type);
|
protected abstract void reportSupertypeLoopError(@NotNull KotlinType type);
|
||||||
@@ -139,6 +141,12 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip
|
|||||||
return visitor.visitTypeParameterDescriptor(this, data);
|
return visitor.visitTypeParameterDescriptor(this, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public StorageManager getStorageManager() {
|
||||||
|
return storageManager;
|
||||||
|
}
|
||||||
|
|
||||||
private class TypeParameterTypeConstructor extends AbstractTypeConstructor {
|
private class TypeParameterTypeConstructor extends AbstractTypeConstructor {
|
||||||
|
|
||||||
private final SupertypeLoopChecker supertypeLoopChecker;
|
private final SupertypeLoopChecker supertypeLoopChecker;
|
||||||
|
|||||||
+21
-13
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
|
|||||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
|
||||||
import org.jetbrains.kotlin.name.Name;
|
import org.jetbrains.kotlin.name.Name;
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
|
import org.jetbrains.kotlin.storage.StorageManager;
|
||||||
import org.jetbrains.kotlin.types.KotlinType;
|
import org.jetbrains.kotlin.types.KotlinType;
|
||||||
import org.jetbrains.kotlin.types.KotlinTypeKt;
|
import org.jetbrains.kotlin.types.KotlinTypeKt;
|
||||||
import org.jetbrains.kotlin.types.Variance;
|
import org.jetbrains.kotlin.types.Variance;
|
||||||
@@ -47,10 +47,12 @@ public class TypeParameterDescriptorImpl extends AbstractTypeParameterDescriptor
|
|||||||
boolean reified,
|
boolean reified,
|
||||||
@NotNull Variance variance,
|
@NotNull Variance variance,
|
||||||
@NotNull Name name,
|
@NotNull Name name,
|
||||||
int index
|
int index,
|
||||||
|
@NotNull StorageManager storageManager
|
||||||
) {
|
) {
|
||||||
TypeParameterDescriptorImpl typeParameterDescriptor =
|
TypeParameterDescriptorImpl typeParameterDescriptor = createForFurtherModification(
|
||||||
createForFurtherModification(containingDeclaration, annotations, reified, variance, name, index, SourceElement.NO_SOURCE);
|
containingDeclaration, annotations, reified, variance, name, index, SourceElement.NO_SOURCE, storageManager
|
||||||
|
);
|
||||||
typeParameterDescriptor.addUpperBound(getBuiltIns(containingDeclaration).getDefaultBound());
|
typeParameterDescriptor.addUpperBound(getBuiltIns(containingDeclaration).getDefaultBound());
|
||||||
typeParameterDescriptor.setInitialized();
|
typeParameterDescriptor.setInitialized();
|
||||||
return typeParameterDescriptor;
|
return typeParameterDescriptor;
|
||||||
@@ -63,10 +65,13 @@ public class TypeParameterDescriptorImpl extends AbstractTypeParameterDescriptor
|
|||||||
@NotNull Variance variance,
|
@NotNull Variance variance,
|
||||||
@NotNull Name name,
|
@NotNull Name name,
|
||||||
int index,
|
int index,
|
||||||
@NotNull SourceElement source
|
@NotNull SourceElement source,
|
||||||
|
@NotNull StorageManager storageManager
|
||||||
) {
|
) {
|
||||||
return createForFurtherModification(containingDeclaration, annotations, reified, variance, name, index, source,
|
return createForFurtherModification(
|
||||||
/* reportSupertypeLoopError = */ null, SupertypeLoopChecker.EMPTY.INSTANCE);
|
containingDeclaration, annotations, reified, variance, name, index, source,
|
||||||
|
null, SupertypeLoopChecker.EMPTY.INSTANCE, storageManager
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TypeParameterDescriptorImpl createForFurtherModification(
|
public static TypeParameterDescriptorImpl createForFurtherModification(
|
||||||
@@ -78,10 +83,13 @@ public class TypeParameterDescriptorImpl extends AbstractTypeParameterDescriptor
|
|||||||
int index,
|
int index,
|
||||||
@NotNull SourceElement source,
|
@NotNull SourceElement source,
|
||||||
@Nullable Function1<KotlinType, Void> reportCycleError,
|
@Nullable Function1<KotlinType, Void> reportCycleError,
|
||||||
@NotNull SupertypeLoopChecker supertypeLoopsResolver
|
@NotNull SupertypeLoopChecker supertypeLoopsResolver,
|
||||||
|
@NotNull StorageManager storageManager
|
||||||
) {
|
) {
|
||||||
return new TypeParameterDescriptorImpl(containingDeclaration, annotations, reified, variance, name, index, source, reportCycleError,
|
return new TypeParameterDescriptorImpl(
|
||||||
supertypeLoopsResolver);
|
containingDeclaration, annotations, reified, variance, name,
|
||||||
|
index, source, reportCycleError, supertypeLoopsResolver, storageManager
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final List<KotlinType> upperBounds = new ArrayList<KotlinType>(1);
|
private final List<KotlinType> upperBounds = new ArrayList<KotlinType>(1);
|
||||||
@@ -96,10 +104,10 @@ public class TypeParameterDescriptorImpl extends AbstractTypeParameterDescriptor
|
|||||||
int index,
|
int index,
|
||||||
@NotNull SourceElement source,
|
@NotNull SourceElement source,
|
||||||
@Nullable Function1<KotlinType, Void> reportCycleError,
|
@Nullable Function1<KotlinType, Void> reportCycleError,
|
||||||
@NotNull SupertypeLoopChecker supertypeLoopsChecker
|
@NotNull SupertypeLoopChecker supertypeLoopsChecker,
|
||||||
|
@NotNull StorageManager storageManager
|
||||||
) {
|
) {
|
||||||
super(LockBasedStorageManager.NO_LOCKS, containingDeclaration, annotations, name, variance, reified, index, source,
|
super(storageManager, containingDeclaration, annotations, name, variance, reified, index, source, supertypeLoopsChecker);
|
||||||
supertypeLoopsChecker);
|
|
||||||
this.reportCycleError = reportCycleError;
|
this.reportCycleError = reportCycleError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ public class DescriptorSubstitutor {
|
|||||||
@NotNull DeclarationDescriptor newContainingDeclaration,
|
@NotNull DeclarationDescriptor newContainingDeclaration,
|
||||||
@NotNull @Mutable List<TypeParameterDescriptor> result
|
@NotNull @Mutable List<TypeParameterDescriptor> result
|
||||||
) {
|
) {
|
||||||
TypeSubstitutor substitutor = substituteTypeParameters(typeParameters, originalSubstitution, newContainingDeclaration, result, null);
|
TypeSubstitutor substitutor = substituteTypeParameters(
|
||||||
|
typeParameters, originalSubstitution, newContainingDeclaration, result, null
|
||||||
|
);
|
||||||
if (substitutor == null) throw new AssertionError("Substitution failed");
|
if (substitutor == null) throw new AssertionError("Substitution failed");
|
||||||
return substitutor;
|
return substitutor;
|
||||||
}
|
}
|
||||||
@@ -65,7 +67,8 @@ public class DescriptorSubstitutor {
|
|||||||
descriptor.getVariance(),
|
descriptor.getVariance(),
|
||||||
descriptor.getName(),
|
descriptor.getName(),
|
||||||
index++,
|
index++,
|
||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE,
|
||||||
|
descriptor.getStorageManager()
|
||||||
);
|
);
|
||||||
|
|
||||||
mutableSubstitution.put(descriptor.getTypeConstructor(), new TypeProjectionImpl(substituted.getDefaultType()));
|
mutableSubstitution.put(descriptor.getTypeConstructor(), new TypeProjectionImpl(substituted.getDefaultType()));
|
||||||
|
|||||||
+4
-1
@@ -43,6 +43,7 @@ import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
|
|||||||
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithAllCompilerChecks
|
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithAllCompilerChecks
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent
|
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent
|
||||||
|
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor
|
import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor
|
||||||
import org.jetbrains.kotlin.idea.core.*
|
import org.jetbrains.kotlin.idea.core.*
|
||||||
@@ -51,6 +52,7 @@ import org.jetbrains.kotlin.idea.core.util.isMultiLine
|
|||||||
import org.jetbrains.kotlin.idea.imports.importableFqName
|
import org.jetbrains.kotlin.idea.imports.importableFqName
|
||||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createClass.ClassKind
|
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createClass.ClassKind
|
||||||
import org.jetbrains.kotlin.idea.refactoring.*
|
import org.jetbrains.kotlin.idea.refactoring.*
|
||||||
|
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||||
import org.jetbrains.kotlin.idea.util.DialogWithEditor
|
import org.jetbrains.kotlin.idea.util.DialogWithEditor
|
||||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||||
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
||||||
@@ -416,7 +418,8 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
|||||||
false,
|
false,
|
||||||
Variance.INVARIANT,
|
Variance.INVARIANT,
|
||||||
Name.identifier(parameterNames[it]),
|
Name.identifier(parameterNames[it]),
|
||||||
it
|
it,
|
||||||
|
jetFileToEdit.getResolutionFacade().frontendService()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-3
@@ -23,15 +23,19 @@ import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
|||||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||||
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
|
||||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||||
|
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
||||||
import org.jetbrains.kotlin.idea.quickfix.KotlinIntentionActionFactoryWithDelegate
|
import org.jetbrains.kotlin.idea.quickfix.KotlinIntentionActionFactoryWithDelegate
|
||||||
import org.jetbrains.kotlin.idea.quickfix.QuickFixWithDelegateFactory
|
import org.jetbrains.kotlin.idea.quickfix.QuickFixWithDelegateFactory
|
||||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createClass.getUnsubstitutedTypeConstraintInfo
|
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.createClass.getUnsubstitutedTypeConstraintInfo
|
||||||
import org.jetbrains.kotlin.idea.refactoring.introduce.isObjectOrNonInnerClass
|
import org.jetbrains.kotlin.idea.refactoring.introduce.isObjectOrNonInnerClass
|
||||||
|
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.parents
|
import org.jetbrains.kotlin.psi.psiUtil.parents
|
||||||
|
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||||
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
||||||
import org.jetbrains.kotlin.types.Variance
|
import org.jetbrains.kotlin.types.Variance
|
||||||
@@ -63,7 +67,9 @@ object CreateTypeParameterByUnresolvedRefActionFactory : KotlinIntentionActionFa
|
|||||||
it is KtProperty || it is KtNamedFunction || it is KtClass
|
it is KtProperty || it is KtNamedFunction || it is KtClass
|
||||||
} as? KtTypeParameterListOwner ?: return null
|
} as? KtTypeParameterListOwner ?: return null
|
||||||
val containingDescriptor = declaration.resolveToDescriptorIfAny() ?: return null
|
val containingDescriptor = declaration.resolveToDescriptorIfAny() ?: return null
|
||||||
val fakeTypeParameter = createFakeTypeParameterDescriptor(containingDescriptor, newName)
|
val fakeTypeParameter = createFakeTypeParameterDescriptor(
|
||||||
|
containingDescriptor, newName, declaration.getResolutionFacade().frontendService<StorageManager>()
|
||||||
|
)
|
||||||
val upperBoundType = getUnsubstitutedTypeConstraintInfo(element)?.let {
|
val upperBoundType = getUnsubstitutedTypeConstraintInfo(element)?.let {
|
||||||
it.performSubstitution(it.typeParameter.typeConstructor to TypeProjectionImpl(fakeTypeParameter.defaultType))?.upperBound
|
it.performSubstitution(it.typeParameter.typeConstructor to TypeProjectionImpl(fakeTypeParameter.defaultType))?.upperBound
|
||||||
}
|
}
|
||||||
@@ -98,9 +104,17 @@ object CreateTypeParameterByUnresolvedRefActionFactory : KotlinIntentionActionFa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createFakeTypeParameterDescriptor(containingDescriptor: DeclarationDescriptor, name: String): TypeParameterDescriptor {
|
fun createFakeTypeParameterDescriptor(
|
||||||
|
containingDescriptor: DeclarationDescriptor,
|
||||||
|
name: String,
|
||||||
|
storageManager: StorageManager
|
||||||
|
): TypeParameterDescriptor {
|
||||||
return TypeParameterDescriptorImpl
|
return TypeParameterDescriptorImpl
|
||||||
.createWithDefaultBound(containingDescriptor, Annotations.EMPTY, false, Variance.INVARIANT, Name.identifier(name), -1)
|
.createWithDefaultBound(
|
||||||
|
containingDescriptor, Annotations.EMPTY, false,
|
||||||
|
Variance.INVARIANT, Name.identifier(name), -1,
|
||||||
|
storageManager
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getPossibleTypeParameterContainers(startFrom: PsiElement): List<KtTypeParameterListOwner> {
|
fun getPossibleTypeParameterContainers(startFrom: PsiElement): List<KtTypeParameterListOwner> {
|
||||||
|
|||||||
+6
-1
@@ -24,12 +24,14 @@ import com.intellij.psi.search.searches.ReferencesSearch
|
|||||||
import com.intellij.usageView.UsageViewTypeLocation
|
import com.intellij.usageView.UsageViewTypeLocation
|
||||||
import org.jetbrains.kotlin.diagnostics.Errors
|
import org.jetbrains.kotlin.diagnostics.Errors
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
|
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||||
import org.jetbrains.kotlin.idea.core.ShortenReferences
|
import org.jetbrains.kotlin.idea.core.ShortenReferences
|
||||||
import org.jetbrains.kotlin.idea.core.addTypeParameter
|
import org.jetbrains.kotlin.idea.core.addTypeParameter
|
||||||
import org.jetbrains.kotlin.idea.core.replaced
|
import org.jetbrains.kotlin.idea.core.replaced
|
||||||
import org.jetbrains.kotlin.idea.core.util.runSynchronouslyWithProgress
|
import org.jetbrains.kotlin.idea.core.util.runSynchronouslyWithProgress
|
||||||
import org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArgumentsIntention
|
import org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArgumentsIntention
|
||||||
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.CreateFromUsageFixBase
|
import org.jetbrains.kotlin.idea.quickfix.createFromUsage.CreateFromUsageFixBase
|
||||||
|
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||||
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
||||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||||
@@ -37,6 +39,7 @@ import org.jetbrains.kotlin.psi.*
|
|||||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
import org.jetbrains.kotlin.psi.psiUtil.getParentOfTypeAndBranch
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.quoteIfNeeded
|
import org.jetbrains.kotlin.psi.psiUtil.quoteIfNeeded
|
||||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||||
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
||||||
import org.jetbrains.kotlin.types.TypeSubstitutor
|
import org.jetbrains.kotlin.types.TypeSubstitutor
|
||||||
import org.jetbrains.kotlin.types.Variance
|
import org.jetbrains.kotlin.types.Variance
|
||||||
@@ -104,7 +107,9 @@ class CreateTypeParameterFromUsageFix(
|
|||||||
?: error("Couldn't create type parameter from '$newTypeParameterText' for '$declaration'")
|
?: error("Couldn't create type parameter from '$newTypeParameterText' for '$declaration'")
|
||||||
elementsToShorten += newTypeParameter
|
elementsToShorten += newTypeParameter
|
||||||
|
|
||||||
val anonymizedTypeParameter = createFakeTypeParameterDescriptor(typeParameter.fakeTypeParameter.containingDeclaration, "_")
|
val anonymizedTypeParameter = createFakeTypeParameterDescriptor(
|
||||||
|
typeParameter.fakeTypeParameter.containingDeclaration, "_", typeParameter.fakeTypeParameter.storageManager
|
||||||
|
)
|
||||||
val anonymizedUpperBoundText = upperBoundType?.let {
|
val anonymizedUpperBoundText = upperBoundType?.let {
|
||||||
TypeSubstitutor
|
TypeSubstitutor
|
||||||
.create(mapOf(typeParameter.fakeTypeParameter.typeConstructor to TypeProjectionImpl(anonymizedTypeParameter.defaultType)))
|
.create(mapOf(typeParameter.fakeTypeParameter.typeConstructor to TypeProjectionImpl(anonymizedTypeParameter.defaultType)))
|
||||||
|
|||||||
+5
-1
@@ -19,11 +19,13 @@ package org.jetbrains.kotlin.idea.quickfix.createFromUsage.createTypeParameter
|
|||||||
import com.intellij.psi.SmartPsiElementPointer
|
import com.intellij.psi.SmartPsiElementPointer
|
||||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
|
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
|
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
|
||||||
import org.jetbrains.kotlin.idea.core.CollectingNameValidator
|
import org.jetbrains.kotlin.idea.core.CollectingNameValidator
|
||||||
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
|
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
|
||||||
import org.jetbrains.kotlin.idea.quickfix.KotlinIntentionActionFactoryWithDelegate
|
import org.jetbrains.kotlin.idea.quickfix.KotlinIntentionActionFactoryWithDelegate
|
||||||
import org.jetbrains.kotlin.idea.quickfix.QuickFixWithDelegateFactory
|
import org.jetbrains.kotlin.idea.quickfix.QuickFixWithDelegateFactory
|
||||||
|
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||||
import org.jetbrains.kotlin.idea.util.getResolutionScope
|
import org.jetbrains.kotlin.idea.util.getResolutionScope
|
||||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
@@ -34,6 +36,7 @@ import org.jetbrains.kotlin.psi.KtUserType
|
|||||||
import org.jetbrains.kotlin.resolve.BindingContext
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||||
import org.jetbrains.kotlin.resolve.scopes.utils.findClassifier
|
import org.jetbrains.kotlin.resolve.scopes.utils.findClassifier
|
||||||
|
import org.jetbrains.kotlin.storage.StorageManager
|
||||||
|
|
||||||
object CreateTypeParameterUnmatchedTypeArgumentActionFactory :
|
object CreateTypeParameterUnmatchedTypeArgumentActionFactory :
|
||||||
KotlinIntentionActionFactoryWithDelegate<KtTypeArgumentList, CreateTypeParameterData>() {
|
KotlinIntentionActionFactoryWithDelegate<KtTypeArgumentList, CreateTypeParameterData>() {
|
||||||
@@ -61,11 +64,12 @@ object CreateTypeParameterUnmatchedTypeArgumentActionFactory :
|
|||||||
scope.findClassifier(Name.identifier(it), NoLookupLocation.FROM_IDE) == null
|
scope.findClassifier(Name.identifier(it), NoLookupLocation.FROM_IDE) == null
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
val storageManager = element.getResolutionFacade().frontendService<StorageManager>()
|
||||||
val typeParameterInfos = suggestedNames.map { name ->
|
val typeParameterInfos = suggestedNames.map { name ->
|
||||||
TypeParameterInfo(
|
TypeParameterInfo(
|
||||||
name,
|
name,
|
||||||
null,
|
null,
|
||||||
createFakeTypeParameterDescriptor(referencedDescriptor, name)
|
createFakeTypeParameterDescriptor(referencedDescriptor, name, storageManager)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return CreateTypeParameterData(referencedDeclaration, typeParameterInfos)
|
return CreateTypeParameterData(referencedDeclaration, typeParameterInfos)
|
||||||
|
|||||||
+3
-2
@@ -34,6 +34,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
|||||||
import org.jetbrains.kotlin.resolve.lazy.LazyClassContext
|
import org.jetbrains.kotlin.resolve.lazy.LazyClassContext
|
||||||
import org.jetbrains.kotlin.resolve.lazy.declarations.ClassMemberDeclarationProvider
|
import org.jetbrains.kotlin.resolve.lazy.declarations.ClassMemberDeclarationProvider
|
||||||
import org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor
|
import org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor
|
||||||
|
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
import org.jetbrains.kotlin.types.KotlinTypeFactory
|
import org.jetbrains.kotlin.types.KotlinTypeFactory
|
||||||
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
import org.jetbrains.kotlin.types.TypeProjectionImpl
|
||||||
@@ -130,7 +131,7 @@ object KSerializerDescriptorResolver {
|
|||||||
thisDescriptor.declaredTypeParameters.mapIndexed { index, param ->
|
thisDescriptor.declaredTypeParameters.mapIndexed { index, param ->
|
||||||
TypeParameterDescriptorImpl.createWithDefaultBound(
|
TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
serializerDescriptor, Annotations.EMPTY, false, Variance.INVARIANT,
|
serializerDescriptor, Annotations.EMPTY, false, Variance.INVARIANT,
|
||||||
param.name, index
|
param.name, index, LockBasedStorageManager.NO_LOCKS
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
serializerDescriptor.initialize(typeParameters)
|
serializerDescriptor.initialize(typeParameters)
|
||||||
@@ -378,7 +379,7 @@ object KSerializerDescriptorResolver {
|
|||||||
serializableClass.declaredTypeParameters.forEach { _ ->
|
serializableClass.declaredTypeParameters.forEach { _ ->
|
||||||
val targ = TypeParameterDescriptorImpl.createWithDefaultBound(
|
val targ = TypeParameterDescriptorImpl.createWithDefaultBound(
|
||||||
parentFunction, Annotations.EMPTY, false, Variance.INVARIANT,
|
parentFunction, Annotations.EMPTY, false, Variance.INVARIANT,
|
||||||
Name.identifier("T$i"), i
|
Name.identifier("T$i"), i, LockBasedStorageManager.NO_LOCKS
|
||||||
)
|
)
|
||||||
|
|
||||||
val pType =
|
val pType =
|
||||||
|
|||||||
Reference in New Issue
Block a user