Rename KotlinTypeFactory::simpleType to simpleTypeWithNonTrivialMemberScope
To state it must be used only for limited number of cases
This commit is contained in:
@@ -76,11 +76,11 @@ private fun KotlinType.approximateNonDynamicFlexibleTypes(
|
||||
(unwrap() as? AbbreviatedType)?.let {
|
||||
return AbbreviatedType(it.expandedType, it.abbreviation.approximateNonDynamicFlexibleTypes(preferNotNull))
|
||||
}
|
||||
return KotlinTypeFactory.simpleType(annotations,
|
||||
constructor,
|
||||
arguments.map { it.substitute { type -> type.approximateFlexibleTypes(preferNotNull = true) } },
|
||||
isMarkedNullable,
|
||||
ErrorUtils.createErrorScope("This type is not supposed to be used in member resolution", true)
|
||||
return KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(annotations,
|
||||
constructor,
|
||||
arguments.map { it.substitute { type -> type.approximateFlexibleTypes(preferNotNull = true) } },
|
||||
isMarkedNullable,
|
||||
ErrorUtils.createErrorScope("This type is not supposed to be used in member resolution", true)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -155,4 +155,4 @@ fun KotlinType.getResolvableApproximations(
|
||||
fun KotlinType.isAbstract(): Boolean {
|
||||
val modality = (constructor.declarationDescriptor as? ClassDescriptor)?.modality
|
||||
return modality == Modality.ABSTRACT || modality == Modality.SEALED
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ internal fun KotlinType.substitute(substitution: KotlinTypeSubstitution, varianc
|
||||
val (projection, typeParameter) = pair
|
||||
TypeProjectionImpl(Variance.INVARIANT, projection.type.substitute(substitution, typeParameter.variance))
|
||||
}
|
||||
KotlinTypeFactory.simpleType(annotations, constructor, newArguments, isMarkedNullable, memberScope)
|
||||
KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(annotations, constructor, newArguments, isMarkedNullable, memberScope)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ object CreateIteratorFunctionActionFactory : CreateCallableMemberFromUsageFactor
|
||||
|
||||
val returnJetTypeParameterType = TypeProjectionImpl(returnJetTypeParameterTypes[0])
|
||||
val returnJetTypeArguments = Collections.singletonList(returnJetTypeParameterType)
|
||||
val newReturnJetType = KotlinTypeFactory.simpleType(returnJetType.annotations,
|
||||
val newReturnJetType = KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(returnJetType.annotations,
|
||||
returnJetType.constructor,
|
||||
returnJetTypeArguments,
|
||||
returnJetType.isMarkedNullable,
|
||||
|
||||
+2
-2
@@ -101,7 +101,7 @@ private object ForceTypeCopySubstitution : TypeSubstitution() {
|
||||
override fun get(key: KotlinType) =
|
||||
with(key) {
|
||||
if (isError) return@with asTypeProjection()
|
||||
KotlinTypeFactory.simpleType(annotations, constructor, arguments, isMarkedNullable, memberScope).asTypeProjection()
|
||||
KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(annotations, constructor, arguments, isMarkedNullable, memberScope).asTypeProjection()
|
||||
}
|
||||
|
||||
override fun isEmpty() = false
|
||||
@@ -118,4 +118,4 @@ fun suggestReceiverNames(project: Project, descriptor: CallableDescriptor): List
|
||||
} ?: CollectingNameValidator(paramNames)
|
||||
val receiverType = descriptor.extensionReceiverParameter?.type ?: return emptyList()
|
||||
return KotlinNameSuggester.suggestNamesByType(receiverType, validator, "receiver")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user