Minor. Rename TypeUtils.containsSpecialType -> contains

This commit is contained in:
Denis Zharkov
2016-01-22 14:46:28 +03:00
parent a5c13ce8cf
commit 5baa0ed4bb
11 changed files with 17 additions and 17 deletions
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.types.replace
import org.jetbrains.kotlin.types.typeUtil.asTypeProjection
import org.jetbrains.kotlin.types.typeUtil.containsSpecialType
import org.jetbrains.kotlin.types.typeUtil.contains
import org.jetbrains.kotlin.utils.addToStdlib.check
// If type 'samType' contains no projection, then it's non-projection parametrization is 'samType' itself
@@ -44,7 +44,7 @@ internal fun nonProjectionParametrization(samType: KotlinType): KotlinType? {
projection.isStarProjection ->
parameter.upperBounds.first().check {
t -> !t.containsSpecialType { it.constructor.declarationDescriptor in parametersSet }
t -> !t.contains { it.constructor.declarationDescriptor in parametersSet }
}?.asTypeProjection() ?: return@nonProjectionParametrization null
else -> projection.type.asTypeProjection()
@@ -39,7 +39,7 @@ fun ResolutionContext<*>.reportTypeMismatchDueToTypeProjection(
expectedType: KotlinType,
expressionType: KotlinType?
): Boolean {
if (!TypeUtils.containsSpecialType(expectedType) { it.isAnyOrNullableAny() || it.isNothing() || it.isNullableNothing() }) return false
if (!TypeUtils.contains(expectedType) { it.isAnyOrNullableAny() || it.isNothing() || it.isNullableNothing() }) return false
val callPosition = this.callPosition
val (resolvedCall, correspondingNotApproximatedTypeByDescriptor: (CallableDescriptor) -> KotlinType?) = when (callPosition) {
@@ -71,7 +71,7 @@ fun ResolutionContext<*>.reportTypeMismatchDueToTypeProjection(
.buildSubstitutor().let { callableDescriptor.substitute(it) } ?: return false
val nonApproximatedExpectedType = correspondingNotApproximatedTypeByDescriptor(substitutedDescriptor) ?: return false
if (!TypeUtils.containsSpecialType(nonApproximatedExpectedType) { it.isCaptured() }) return false
if (!TypeUtils.contains(nonApproximatedExpectedType) { it.isCaptured() }) return false
if (expectedType.isNothing()) {
if (callPosition is CallPosition.PropertyAssignment) {
@@ -843,7 +843,7 @@ class DeclarationsChecker(
descriptor: PropertyDescriptor): Boolean {
val receiverParameter = descriptor.extensionReceiverParameter ?: return false
return TypeUtils.containsSpecialType(receiverParameter.type) { parameter == it.constructor.declarationDescriptor }
return TypeUtils.contains(receiverParameter.type) { parameter == it.constructor.declarationDescriptor }
}
private fun hasDefaultConstructor(classDescriptor: ClassDescriptor) =
@@ -326,7 +326,7 @@ class FunctionDescriptorResolver(
}
else {
if (isFunctionLiteral(functionDescriptor) || isFunctionExpression(functionDescriptor)) {
val containsUninferredParameter = TypeUtils.containsSpecialType(expectedType) {
val containsUninferredParameter = TypeUtils.contains(expectedType) {
TypeUtils.isDontCarePlaceholder(it) || ErrorUtils.isUninferredParameter(it)
}
if (expectedType == null || containsUninferredParameter) {
@@ -44,7 +44,7 @@ enum class ResolveArgumentsMode {
fun hasUnknownFunctionParameter(type: KotlinType): Boolean {
assert(ReflectionTypes.isCallableType(type)) { "type $type is not a function or property" }
return getParameterArgumentsOfCallableType(type).any {
TypeUtils.containsSpecialType(it.type, DONT_CARE) || ErrorUtils.containsUninferredParameter(it.type)
TypeUtils.contains(it.type, DONT_CARE) || ErrorUtils.containsUninferredParameter(it.type)
}
}
@@ -100,7 +100,7 @@ class ConstraintSystemBuilderImpl : ConstraintSystem.Builder {
)))
}
private fun KotlinType.isProper() = !TypeUtils.containsSpecialType(this) {
private fun KotlinType.isProper() = !TypeUtils.contains(this) {
type -> type.constructor.declarationDescriptor.let { it is TypeParameterDescriptor && isMyTypeVariable(it) }
}
@@ -119,7 +119,7 @@ internal class ConstraintSystemImpl(
if (substituteOriginal) variable.originalTypeParameter.typeConstructor
else variable.type.constructor
val type =
if (value != null && !TypeUtils.containsSpecialType(value, DONT_CARE)) value
if (value != null && !TypeUtils.contains(value, DONT_CARE)) value
else getDefaultType(variable)
substitutionContext.put(typeConstructor, TypeProjectionImpl(type))
}