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) {