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