[NI] Minor. Fixes after review
This commit is contained in:
committed by
Mikhail Zarechenskiy
parent
93d80c252f
commit
b344865c15
+2
-3
@@ -31,7 +31,6 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.NotEnoughInformationFo
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.returnTypeOrNothing
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.substituteAndApproximateCapturedTypes
|
||||
import org.jetbrains.kotlin.resolve.calls.model.*
|
||||
import org.jetbrains.kotlin.resolve.calls.tower.ResolutionCandidateApplicability
|
||||
import org.jetbrains.kotlin.resolve.calls.tower.ResolutionCandidateStatus
|
||||
import org.jetbrains.kotlin.types.TypeApproximator
|
||||
import org.jetbrains.kotlin.types.TypeApproximatorConfiguration
|
||||
@@ -220,8 +219,8 @@ class KotlinCallCompleter(
|
||||
lambda.analyzed = true
|
||||
lambda.resultArguments = resolutionCallbacks.analyzeAndGetLambdaResultArguments(lambda.outerCall, lambda.argument, lambda.isSuspend, receiver, parameters, expectedType)
|
||||
|
||||
for (innerCall in lambda.resultArguments) {
|
||||
checkSimpleArgument(c.getBuilder(), innerCall, lambda.returnType.let(::substitute))
|
||||
for (resultLambdaArgument in lambda.resultArguments) {
|
||||
checkSimpleArgument(c.getBuilder(), resultLambdaArgument, lambda.returnType.let(::substitute))
|
||||
}
|
||||
|
||||
if (lambda.resultArguments.isEmpty()) {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.types.typeUtil.builtIns
|
||||
fun createPostponedArgumentAndPerformInitialChecks(
|
||||
kotlinCall: KotlinCall,
|
||||
csBuilder: ConstraintSystemBuilder,
|
||||
argument: PostponableCallArgument,
|
||||
argument: PostponableKotlinCallArgument,
|
||||
parameterDescriptor: ValueParameterDescriptor,
|
||||
postponeCallableReferenceArguments: MutableList<PostponeCallableReferenceArgument>
|
||||
): KotlinCallDiagnostic? {
|
||||
|
||||
+5
-3
@@ -235,9 +235,11 @@ internal object CheckArguments : ResolutionPart {
|
||||
for (argument in resolvedCallArgument.arguments) {
|
||||
|
||||
val diagnostic = when (argument) {
|
||||
is SimpleKotlinCallArgument -> checkSimpleArgument(csBuilder, argument, argument.getExpectedType(parameterDescriptor))
|
||||
is PostponableCallArgument ->
|
||||
createPostponedArgumentAndPerformInitialChecks(kotlinCall, csBuilder, argument, parameterDescriptor, postponeCallableReferenceArguments)
|
||||
is SimpleKotlinCallArgument ->
|
||||
checkSimpleArgument(csBuilder, argument, argument.getExpectedType(parameterDescriptor))
|
||||
is PostponableKotlinCallArgument ->
|
||||
createPostponedArgumentAndPerformInitialChecks(
|
||||
kotlinCall, csBuilder, argument, parameterDescriptor, postponeCallableReferenceArguments)
|
||||
else -> unexpectedArgument(argument)
|
||||
}
|
||||
diagnostics.addIfNotNull(diagnostic)
|
||||
|
||||
+4
-4
@@ -39,7 +39,7 @@ interface KotlinCallArgument {
|
||||
val argumentName: Name?
|
||||
}
|
||||
|
||||
interface PostponableCallArgument : KotlinCallArgument
|
||||
interface PostponableKotlinCallArgument : KotlinCallArgument
|
||||
|
||||
interface SimpleKotlinCallArgument : KotlinCallArgument, ReceiverKotlinCallArgument {
|
||||
override val receiver: ReceiverValueWithSmartCastInfo
|
||||
@@ -53,7 +53,7 @@ interface SubKotlinCallArgument : SimpleKotlinCallArgument {
|
||||
val resolvedCall: ResolvedKotlinCall.OnlyResolvedKotlinCall
|
||||
}
|
||||
|
||||
interface LambdaKotlinCallArgument : PostponableCallArgument {
|
||||
interface LambdaKotlinCallArgument : PostponableKotlinCallArgument {
|
||||
override val isSpread: Boolean
|
||||
get() = false
|
||||
|
||||
@@ -112,7 +112,7 @@ sealed class LHSResult {
|
||||
object Empty: LHSResult()
|
||||
}
|
||||
|
||||
interface CallableReferenceKotlinCallArgument : PostponableCallArgument {
|
||||
interface CallableReferenceKotlinCallArgument : PostponableKotlinCallArgument {
|
||||
override val isSpread: Boolean
|
||||
get() = false
|
||||
|
||||
@@ -121,7 +121,7 @@ interface CallableReferenceKotlinCallArgument : PostponableCallArgument {
|
||||
val rhsName: Name
|
||||
}
|
||||
|
||||
interface CollectionLiteralKotlinCallArgument : PostponableCallArgument
|
||||
interface CollectionLiteralKotlinCallArgument : PostponableKotlinCallArgument
|
||||
|
||||
interface TypeArgument
|
||||
|
||||
|
||||
Reference in New Issue
Block a user