Add additional diagnostic for EA-225967
This commit is contained in:
@@ -45,6 +45,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.*
|
|||||||
import org.jetbrains.kotlin.types.*
|
import org.jetbrains.kotlin.types.*
|
||||||
import org.jetbrains.kotlin.types.expressions.*
|
import org.jetbrains.kotlin.types.expressions.*
|
||||||
import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContext
|
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.firstIsInstanceOrNull
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
|
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@@ -548,6 +549,11 @@ class PSICallResolver(
|
|||||||
assert(externalLambdaArguments.isEmpty()) {
|
assert(externalLambdaArguments.isEmpty()) {
|
||||||
"Unexpected lambda parameters for call $oldCall"
|
"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 ?: "<no file>")
|
||||||
|
}
|
||||||
allValueArguments.last()
|
allValueArguments.last()
|
||||||
} else {
|
} else {
|
||||||
if (externalLambdaArguments.size > 1) {
|
if (externalLambdaArguments.size > 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user