Fix compiler warnings in compiler code

This commit is contained in:
Alexander Udalov
2020-08-14 12:55:43 +02:00
parent 9b94e073af
commit a21f273570
84 changed files with 149 additions and 141 deletions
@@ -43,6 +43,7 @@ open class ContractDescription(
ContractInterpretationDispatcher().convertContractDescriptorToFunctor(this)
}
@Suppress("UNUSED_PARAMETER")
fun getFunctor(usageModule: ModuleDescriptor): Functor? = computeFunctor.invoke()
}
@@ -14,7 +14,6 @@ import org.jetbrains.kotlin.resolve.calls.components.CreateFreshVariablesSubstit
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemOperation
import org.jetbrains.kotlin.resolve.calls.inference.components.FreshVariableNewTypeSubstitutor
import org.jetbrains.kotlin.resolve.calls.inference.model.ArgumentConstraintPosition
import org.jetbrains.kotlin.resolve.calls.inference.model.LowerPriorityToPreserveCompatibility
import org.jetbrains.kotlin.resolve.calls.model.*
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind.DISPATCH_RECEIVER
@@ -351,10 +350,11 @@ class CallableReferencesCandidateFactory(
// If we've already mapped an argument to this value parameter, it'll always be a type mismatch.
mappedArguments[valueParameter] = ResolvedCallArgument.SimpleArgument(fakeArgument)
}
VarargMappingState.MAPPED_WITH_PLAIN_ARGS -> {
mappedVarargElements.getOrPut(valueParameter) { ArrayList() }.add(fakeArgument)
}
VarargMappingState.UNMAPPED -> {
}
}
} else {
mappedArgument = substitutedParameter.type
@@ -390,13 +390,13 @@ class CallableReferencesCandidateFactory(
CoercionStrategy.NO_COERCION
val adaptedArguments =
if (expectedType != null && ReflectionTypes.isBaseTypeForNumberedReferenceTypes(expectedType))
if (ReflectionTypes.isBaseTypeForNumberedReferenceTypes(expectedType))
emptyMap()
else
mappedArguments
val suspendConversionStrategy =
if (!descriptor.isSuspend && expectedType?.isSuspendFunctionType == true) {
if (!descriptor.isSuspend && expectedType.isSuspendFunctionType) {
SuspendConversionStrategy.SUSPEND_CONVERSION
} else {
SuspendConversionStrategy.NO_CONVERSION
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.resolve.calls.components.ClassicTypeSystemContextForCS
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder
import org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl
import org.jetbrains.kotlin.resolve.calls.inference.model.SimpleConstraintSystemConstraintPosition
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableFromCallableDescriptor
import org.jetbrains.kotlin.resolve.calls.inference.substitute
import org.jetbrains.kotlin.resolve.calls.results.SimpleConstraintSystem
@@ -60,8 +61,7 @@ class SimpleConstraintSystemImpl(constraintInjector: ConstraintInjector, builtIn
csBuilder.addSubtypeConstraint(
subType,
superType,
@Suppress("DEPRECATION")
org.jetbrains.kotlin.resolve.calls.inference.model.SimpleConstraintSystemConstraintPosition
SimpleConstraintSystemConstraintPosition
)
}
@@ -94,7 +94,7 @@ class CoroutinePosition() : ConstraintPosition() {
override fun toString(): String = "for coroutine call"
}
@Deprecated("Should be used only in SimpleConstraintSystemImpl")
// TODO: should be used only in SimpleConstraintSystemImpl
object SimpleConstraintSystemConstraintPosition : ConstraintPosition()
abstract class ConstraintSystemCallDiagnostic(applicability: ResolutionCandidateApplicability) : KotlinCallDiagnostic(applicability) {
@@ -58,7 +58,7 @@ interface LambdaKotlinCallArgument : PostponableKotlinCallArgument {
*/
var hasBuilderInferenceAnnotation: Boolean
get() = false
set(value) {}
set(@Suppress("UNUSED_PARAMETER") value) {}
/**
* parametersTypes == null means, that there is no declared arguments
@@ -150,7 +150,7 @@ sealed class UnstableSmartCast(
operator fun invoke(
argument: ExpressionKotlinCallArgument,
targetType: UnwrappedType,
isReceiver: Boolean = false, // for reproducing OI behaviour
@Suppress("UNUSED_PARAMETER") isReceiver: Boolean = false, // for reproducing OI behaviour
): UnstableSmartCast {
return UnstableSmartCastResolutionError(argument, targetType)
}