From 38b6b737457bba9118f539a920b664a0f2901746 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Tue, 3 Mar 2020 15:24:15 +0900 Subject: [PATCH] Add additional diagnostic for EA-225967 --- .../jetbrains/kotlin/resolve/calls/tower/PSICallResolver.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/PSICallResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/PSICallResolver.kt index c4037443260..e3e0c8ac86e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/PSICallResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/PSICallResolver.kt @@ -45,6 +45,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.* import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.expressions.* import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContext +import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult import java.util.* @@ -548,6 +549,11 @@ class PSICallResolver( assert(externalLambdaArguments.isEmpty()) { "Unexpected lambda parameters for call $oldCall" } + if (allValueArguments.isEmpty()) { + throw KotlinExceptionWithAttachments("Can not find an external argument for 'set' method") + .withAttachment("callElement.kt", oldCall.callElement.text) + .withAttachment("file.kt", oldCall.callElement.takeIf { it.isValid }?.containingFile?.text ?: "") + } allValueArguments.last() } else { if (externalLambdaArguments.size > 1) {