Implicit receivers hierarchy for deserialized classes

This commit is contained in:
Andrey Breslav
2013-06-04 13:57:06 +04:00
committed by Alexander Udalov
parent ae9950d88d
commit 1fe9b58181
2 changed files with 14 additions and 1 deletions
@@ -381,6 +381,12 @@ public class DeserializedClassDescriptor extends ClassDescriptorBase implements
}
}
@Nullable
@Override
protected ReceiverParameterDescriptor getImplicitReceiver() {
return classDescriptor.getThisAsReceiverParameter();
}
@Nullable
@Override
protected ClassifierDescriptor getClassDescriptor(@NotNull Name name) {
@@ -239,9 +239,16 @@ public abstract class DeserializedMemberScope implements JetScope {
@NotNull
@Override
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
throw new UnsupportedOperationException("Should not be called");
ReceiverParameterDescriptor receiver = getImplicitReceiver();
if (receiver != null) {
return Collections.singletonList(receiver);
}
return Collections.emptyList();
}
@Nullable
protected abstract ReceiverParameterDescriptor getImplicitReceiver();
@NotNull
@Override
public Collection<DeclarationDescriptor> getOwnDeclaredDescriptors() {