KT-5873 Exception in ArgumentMatchImpl on smart completion

#KT-5873 Fixed
This commit is contained in:
Svetlana Isakova
2014-09-26 18:38:20 +04:00
parent f0e7435254
commit 1d2d2f4845
4 changed files with 18 additions and 1 deletions
@@ -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
}
+9
View File
@@ -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");