KT-5873 Exception in ArgumentMatchImpl on smart completion
#KT-5873 Fixed
This commit is contained in:
@@ -109,6 +109,7 @@ public class CandidateResolver {
|
||||
if (argumentMappingStatus == ValueArgumentsToParametersMapper.Status.STRONG_ERROR
|
||||
&& !CallResolverUtil.isInvokeCallOnExpressionWithBothReceivers(context.call)) {
|
||||
candidateCall.addStatus(RECEIVER_PRESENCE_ERROR);
|
||||
checkAllValueArguments(context, SHAPE_FUNCTION_ARGUMENTS);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -45,7 +45,8 @@ public trait ArgumentMatch : ArgumentMapping {
|
||||
|
||||
class ArgumentMatchImpl(override val valueParameter: ValueParameterDescriptor): ArgumentMatch {
|
||||
private var _status: ArgumentMatchStatus? = null
|
||||
override val status: ArgumentMatchStatus get() = _status!!
|
||||
override val status: ArgumentMatchStatus
|
||||
get() = _status!!
|
||||
fun recordMatchStatus(status: ArgumentMatchStatus) {
|
||||
_status = status
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
public fun f(s: String) {
|
||||
g("", <caret>)
|
||||
}
|
||||
|
||||
fun g(p1: String, p2: String) { }
|
||||
}
|
||||
|
||||
// EXIST: s
|
||||
@@ -410,6 +410,12 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt5873.kt")
|
||||
public void testKt5873() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/smart/kt5873.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Lambda1.kt")
|
||||
public void testLambda1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/smart/Lambda1.kt");
|
||||
|
||||
Reference in New Issue
Block a user