Support force-resolving lazy annotations
This commit is contained in:
@@ -18,6 +18,7 @@ package org.jetbrains.jet.lang.resolve.lazy;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.TypeConstructor;
|
||||
|
||||
@@ -38,8 +39,16 @@ public class ForceResolveUtil {
|
||||
}
|
||||
|
||||
public static void forceResolveAllContents(@NotNull TypeConstructor typeConstructor) {
|
||||
if (typeConstructor instanceof LazyEntity) {
|
||||
LazyEntity lazyConstructor = (LazyEntity) typeConstructor;
|
||||
doForceResolveAllContents(typeConstructor);
|
||||
}
|
||||
|
||||
public static void forceResolveAllContents(@NotNull Annotations annotations) {
|
||||
doForceResolveAllContents(annotations);
|
||||
}
|
||||
|
||||
private static void doForceResolveAllContents(Object object) {
|
||||
if (object instanceof LazyEntity) {
|
||||
LazyEntity lazyConstructor = (LazyEntity) object;
|
||||
lazyConstructor.forceResolveAllContents();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -319,7 +319,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyEnti
|
||||
|
||||
@Override
|
||||
public void forceResolveAllContents() {
|
||||
getAnnotations();
|
||||
ForceResolveUtil.forceResolveAllContents(getAnnotations());
|
||||
getClassObjectDescriptor();
|
||||
getClassObjectType();
|
||||
getConstructors();
|
||||
@@ -460,7 +460,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyEnti
|
||||
|
||||
@Override
|
||||
public void forceResolveAllContents() {
|
||||
getAnnotations();
|
||||
ForceResolveUtil.forceResolveAllContents(getAnnotations());
|
||||
getSupertypes();
|
||||
getParameters();
|
||||
}
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.AbstractLazyTypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ForceResolveUtil;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.LazyEntity;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils;
|
||||
@@ -113,7 +114,7 @@ public class LazyTypeParameterDescriptor extends AbstractLazyTypeParameterDescri
|
||||
|
||||
@Override
|
||||
public void forceResolveAllContents() {
|
||||
getAnnotations();
|
||||
ForceResolveUtil.forceResolveAllContents(getAnnotations());
|
||||
getClassObjectType();
|
||||
getContainingDeclaration();
|
||||
getDefaultType();
|
||||
|
||||
Reference in New Issue
Block a user