KT-6821 Go to reference on "by" keyword in delegated property doesn't navigate to propertyDelegated

#KT-6821 fixed
This commit is contained in:
Evgeny Gerashchenko
2015-03-04 19:31:49 +03:00
parent 9a17bce179
commit 0a824edace
4 changed files with 12 additions and 8 deletions
@@ -42,9 +42,9 @@ public class JetPropertyDelegationMethodsReference(element: JetPropertyDelegate)
if (descriptor !is PropertyDescriptor) {
return Collections.emptyList()
}
return descriptor.getAccessors().map {
return (descriptor.getAccessors().map {
accessor ->
context.get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL, accessor)?.getCandidateDescriptor()
}.filterNotNull()
} + listOf(context.get(BindingContext.DELEGATED_PROPERTY_PD_RESOLVED_CALL, descriptor)?.getCandidateDescriptor())).filterNotNull()
}
}
@@ -4,8 +4,10 @@ class Foo
fun Foo.get(_this: Any?, p: Any?): Int = 1
fun Foo.set(_this: Any?, p: Any?, val: Any?) {}
fun Foo.propertyDelegated(p: Any?) {}
// MULTIRESOLVE
// REF: (for Foo in <root>).get(Any?,Any?)
// REF: (for Foo in <root>).set(Any?,Any?,Any?)
// REF: (for Foo in <root>).propertyDelegated(Any?)
@@ -3,9 +3,11 @@ var x: Int <caret>by Foo()
class Foo {
fun get(_this: Any?, p: Any?): Int = 1
fun set(_this: Any?, p: Any?, val: Any?) {}
fun propertyDelegated(p: Any?)
}
// MULTIRESOLVE
// REF: (in Foo).get(Any?,Any?)
// REF: (in Foo).set(Any?,Any?,Any?)
// REF: (in Foo).propertyDelegated(Any?)
@@ -421,15 +421,15 @@ public class ReferenceResolveTestGenerated extends AbstractReferenceResolveTest
doTest(fileName);
}
@TestMetadata("getSetExtension.kt")
public void testGetSetExtension() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetExtension.kt");
@TestMetadata("getSetPropertyDelegatedExtension.kt")
public void testGetSetPropertyDelegatedExtension() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedExtension.kt");
doTest(fileName);
}
@TestMetadata("getSetMember.kt")
public void testGetSetMember() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetMember.kt");
@TestMetadata("getSetPropertyDelegatedMember.kt")
public void testGetSetPropertyDelegatedMember() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedMember.kt");
doTest(fileName);
}
}