getDeclaredCallableMembers() fixed for lazy classes

Otherwise synthesized members were not included
This commit is contained in:
Andrey Breslav
2014-02-27 13:49:17 +04:00
parent d97a5a0d63
commit c04ce4401f
2 changed files with 3 additions and 8 deletions
@@ -206,16 +206,11 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
@NotNull
@Override
public Collection<DeclarationDescriptor> getAllDescriptors() {
Collection<DeclarationDescriptor> result = new LinkedHashSet<DeclarationDescriptor>(getDescriptorsFromDeclaredElements());
Collection<DeclarationDescriptor> result = new LinkedHashSet<DeclarationDescriptor>(descriptorsFromDeclaredElements.invoke());
result.addAll(extraDescriptors.invoke());
return result;
}
@NotNull
/*package*/ Collection<DeclarationDescriptor> getDescriptorsFromDeclaredElements() {
return descriptorsFromDeclaredElements.invoke();
}
@NotNull
private Collection<DeclarationDescriptor> computeDescriptorsFromDeclaredElements() {
List<JetDeclaration> declarations = declarationProvider.getAllDeclarations();
@@ -287,4 +282,4 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
p.popIndent();
p.println("}");
}
}
}
@@ -225,7 +225,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyEnti
public Collection<CallableMemberDescriptor> getDeclaredCallableMembers() {
//noinspection unchecked
return (Collection) KotlinPackage.filter(
unsubstitutedMemberScope.getDescriptorsFromDeclaredElements(),
unsubstitutedMemberScope.getAllDescriptors(),
new Function1<DeclarationDescriptor, Boolean>() {
@Override
public Boolean invoke(DeclarationDescriptor descriptor) {