Allow builder inference calls with labeled lambda
^KT-24993 Fixed
This commit is contained in:
+5
-5
@@ -14,10 +14,7 @@ import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.psi.KtFunction
|
||||
import org.jetbrains.kotlin.psi.KtLambdaExpression
|
||||
import org.jetbrains.kotlin.psi.ValueArgument
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRendererOptions
|
||||
import org.jetbrains.kotlin.resolve.calls.ArgumentTypeResolver
|
||||
@@ -335,8 +332,11 @@ fun isCoroutineCallWithAdditionalInference(
|
||||
else
|
||||
parameterDescriptor.hasSuspendFunctionType
|
||||
|
||||
val pureExpression = argument.getArgumentExpression()
|
||||
val baseExpression = if (pureExpression is KtLabeledExpression) pureExpression.baseExpression else pureExpression
|
||||
|
||||
return parameterHasOptIn &&
|
||||
argument.getArgumentExpression() is KtLambdaExpression &&
|
||||
baseExpression is KtLambdaExpression &&
|
||||
parameterDescriptor.type.let { it.isBuiltinFunctionalType && it.getReceiverTypeFromFunctionType() != null }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user