Pass NameResolver to loadClassAnnotations()

It's not used at the moment, but will be in the upcoming implementation of
annotation loader (for JS, built-ins and type annotations)
This commit is contained in:
Alexander Udalov
2014-11-26 17:25:24 +03:00
parent 19ad2406ff
commit 8cb1c7f0e6
3 changed files with 16 additions and 4 deletions
@@ -56,7 +56,11 @@ public class AnnotationDescriptorLoader extends BaseDescriptorLoader implements
@NotNull
@Override
public List<AnnotationDescriptor> loadClassAnnotations(@NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto) {
public List<AnnotationDescriptor> loadClassAnnotations(
@NotNull ClassDescriptor descriptor,
@NotNull ProtoBuf.Class classProto,
@NotNull NameResolver nameResolver
) {
KotlinJvmBinaryClass kotlinClass = findKotlinClassByDescriptor(descriptor);
if (kotlinClass == null) {
// This means that the resource we're constructing the descriptor from is no longer present: KotlinClassFinder had found the
@@ -29,7 +29,11 @@ public interface AnnotationLoader {
AnnotationLoader UNSUPPORTED = new AnnotationLoader() {
@NotNull
@Override
public List<AnnotationDescriptor> loadClassAnnotations(@NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto) {
public List<AnnotationDescriptor> loadClassAnnotations(
@NotNull ClassDescriptor descriptor,
@NotNull ProtoBuf.Class classProto,
@NotNull NameResolver nameResolver
) {
return notSupported();
}
@@ -63,7 +67,11 @@ public interface AnnotationLoader {
};
@NotNull
List<AnnotationDescriptor> loadClassAnnotations(@NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto);
List<AnnotationDescriptor> loadClassAnnotations(
@NotNull ClassDescriptor descriptor,
@NotNull ProtoBuf.Class classProto,
@NotNull NameResolver nameResolver
);
@NotNull
List<AnnotationDescriptor> loadCallableAnnotations(
@@ -70,7 +70,7 @@ public class DeserializedClassDescriptor(
Annotations.EMPTY
}
else DeserializedAnnotations(c.storageManager) {
c.components.annotationLoader.loadClassAnnotations(this, classProto)
c.components.annotationLoader.loadClassAnnotations(this, classProto, c.nameResolver)
}
override fun getContainingDeclaration(): DeclarationDescriptor = containingDeclaration