Fixed EA-70945

This commit is contained in:
Valentin Kipyatkov
2016-03-01 11:34:12 +03:00
parent 65662d7c99
commit 135ec78d7d
3 changed files with 17 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
class A {
val foo: Int = 0
}
fun f() {
A().foo(<caret>)
}
// NUMBER: 0
@@ -113,6 +113,12 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT
doTest(fileName);
}
@TestMetadata("EA70945.kt")
public void testEA70945() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/EA70945.kt");
doTest(fileName);
}
@TestMetadata("EmptyPrefix.kt")
public void testEmptyPrefix() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/EmptyPrefix.kt");
@@ -188,6 +188,8 @@ class ExpectedInfos(
private fun calculateForArgument(callElement: KtCallElement, argument: ValueArgument): Collection<ExpectedInfo>? {
val call = callElement.getCall(bindingContext) ?: return null
// sometimes we get wrong call (see testEA70945) TODO: refactor resolve so that it does not happen
if (call.callElement != callElement) return null
return calculateForArgument(call, argument)
}