EA-39104 - IAE: DescriptorResolver.getPropertyDeclarationInnerScope
Fixed
This commit is contained in:
@@ -170,11 +170,20 @@ public class ResolveSessionUtils {
|
|||||||
bodyResolver.resolvePropertyInitializer(jetProperty, descriptor, propertyInitializer, propertyResolutionScope);
|
bodyResolver.resolvePropertyInitializer(jetProperty, descriptor, propertyInitializer, propertyResolutionScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addAccessorDeclaringScopes(jetProperty, bodyResolveContext, propertyResolutionScope);
|
||||||
|
bodyResolver.resolvePropertyAccessors(jetProperty, descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addAccessorDeclaringScopes(
|
||||||
|
JetProperty jetProperty,
|
||||||
|
EmptyBodyResolveContext bodyResolveContext,
|
||||||
|
JetScope propertyResolutionScope
|
||||||
|
) {
|
||||||
|
ImmutableMap.Builder<JetDeclaration, JetScope> builder = ImmutableMap.builder();
|
||||||
for (final JetPropertyAccessor propertyAccessor : jetProperty.getAccessors()) {
|
for (final JetPropertyAccessor propertyAccessor : jetProperty.getAccessors()) {
|
||||||
bodyResolveContext.setDeclaringScopes(
|
builder.put(propertyAccessor, propertyResolutionScope);
|
||||||
ImmutableMap.<JetDeclaration, JetScope>builder().put(propertyAccessor, propertyResolutionScope).build());
|
|
||||||
bodyResolver.resolvePropertyAccessors(jetProperty, descriptor);
|
|
||||||
}
|
}
|
||||||
|
bodyResolveContext.setDeclaringScopes(builder.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void functionAdditionalResolve(
|
private static void functionAdditionalResolve(
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
val a: Int = 1
|
||||||
|
get() {
|
||||||
|
return $a
|
||||||
|
}
|
||||||
|
set(v) {
|
||||||
|
$a = <caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// EXIST: a
|
||||||
@@ -244,6 +244,10 @@ public class JetBasicCompletionTest extends JetCompletionTestBase {
|
|||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testCompletionInSetter() {
|
||||||
|
doTest();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTestDataPath() {
|
protected String getTestDataPath() {
|
||||||
return new File(PluginTestCaseBase.getTestDataPathBase(), "/completion/basic").getPath() +
|
return new File(PluginTestCaseBase.getTestDataPathBase(), "/completion/basic").getPath() +
|
||||||
|
|||||||
Reference in New Issue
Block a user