EA-39104 - IAE: DescriptorResolver.getPropertyDeclarationInnerScope
Fixed
This commit is contained in:
@@ -170,11 +170,20 @@ public class ResolveSessionUtils {
|
||||
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()) {
|
||||
bodyResolveContext.setDeclaringScopes(
|
||||
ImmutableMap.<JetDeclaration, JetScope>builder().put(propertyAccessor, propertyResolutionScope).build());
|
||||
bodyResolver.resolvePropertyAccessors(jetProperty, descriptor);
|
||||
builder.put(propertyAccessor, propertyResolutionScope);
|
||||
}
|
||||
bodyResolveContext.setDeclaringScopes(builder.build());
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public void testCompletionInSetter() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return new File(PluginTestCaseBase.getTestDataPathBase(), "/completion/basic").getPath() +
|
||||
|
||||
Reference in New Issue
Block a user