Refine naming: *TypeVariable -> *TypeParameter
This commit is contained in:
committed by
TeamCityServer
parent
7c3383bb39
commit
4733a0d970
+1
-1
@@ -285,7 +285,7 @@ class JavaNullabilityChecker(val upperBoundChecker: UpperBoundChecker) : Additio
|
||||
subType: KotlinType,
|
||||
superType: KotlinType
|
||||
): Boolean {
|
||||
if (superType !is NotNullTypeVariable || subType is NotNullTypeVariable) return false
|
||||
if (superType !is NotNullTypeParameter || subType is NotNullTypeParameter) return false
|
||||
return !AbstractNullabilityChecker.isSubtypeOfAny(
|
||||
createClassicTypeCheckerState(isErrorTypeEqualsToAnything = true),
|
||||
subType
|
||||
|
||||
+3
-5
@@ -44,8 +44,6 @@ import org.jetbrains.kotlin.types.typeUtil.builtIns
|
||||
import org.jetbrains.kotlin.types.typeUtil.defaultProjections
|
||||
import org.jetbrains.kotlin.types.typeUtil.isDefaultBound
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
||||
import java.lang.IllegalArgumentException
|
||||
import java.lang.IllegalStateException
|
||||
import java.util.*
|
||||
|
||||
open class ConstraintSystemBuilderImpl(private val mode: Mode = ConstraintSystemBuilderImpl.Mode.INFERENCE) : ConstraintSystem.Builder {
|
||||
@@ -310,9 +308,9 @@ open class ConstraintSystemBuilderImpl(private val mode: Mode = ConstraintSystem
|
||||
// Foo >: T!
|
||||
// both Foo and Foo? transform to Foo! here
|
||||
if (parameterType.isFlexible()) {
|
||||
val customTypeVariable = parameterType.getCustomTypeVariable()
|
||||
if (customTypeVariable != null) {
|
||||
newConstrainingType = customTypeVariable.substitutionResult(constrainingType)
|
||||
val customTypeParameter = parameterType.getCustomTypeParameter()
|
||||
if (customTypeParameter != null) {
|
||||
newConstrainingType = customTypeParameter.substitutionResult(constrainingType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ private fun checkExpressionArgument(
|
||||
val position = if (isReceiver) ReceiverConstraintPositionImpl(expressionArgument) else ArgumentConstraintPositionImpl(expressionArgument)
|
||||
|
||||
// Used only for arguments with @NotNull annotation
|
||||
if (expectedType is NotNullTypeVariable && argumentType.isMarkedNullable) {
|
||||
if (expectedType is NotNullTypeParameter && argumentType.isMarkedNullable) {
|
||||
diagnosticsHolder.addDiagnostic(ArgumentNullabilityMismatchDiagnostic(expectedType, argumentType, expressionArgument))
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
|
||||
if (type.isDefinitelyNotNullType) {
|
||||
replacement = replacement.makeDefinitelyNotNullOrNotNull()
|
||||
}
|
||||
if (type is CustomTypeVariable) {
|
||||
if (type is CustomTypeParameter) {
|
||||
replacement = type.substitutionResult(replacement).unwrap()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user