示例#1
0
 @NotNull
 @Override
 public Collection<? extends JetType> getSupertypes() {
   if (supertypes == null) {
     if (resolveSession.isClassSpecial(DescriptorUtils.getFQName(LazyClassDescriptor.this))) {
       this.supertypes = Collections.emptyList();
     } else {
       JetClassOrObject classOrObject =
           declarationProvider.getOwnerInfo().getCorrespondingClassOrObject();
       if (classOrObject == null) {
         this.supertypes = Collections.emptyList();
       } else {
         List<JetType> allSupertypes =
             resolveSession
                 .getInjector()
                 .getDescriptorResolver()
                 .resolveSupertypes(
                     getScopeForClassHeaderResolution(),
                     LazyClassDescriptor.this,
                     classOrObject,
                     resolveSession.getTrace());
         List<JetType> validSupertypes =
             Lists.newArrayList(Collections2.filter(allSupertypes, VALID_SUPERTYPE));
         this.supertypes = validSupertypes;
         findAndDisconnectLoopsInTypeHierarchy(validSupertypes);
       }
     }
   }
   return supertypes;
 }
示例#2
0
                  @Override
                  public Collection<JetType> invoke() {
                    if (resolveSession.isClassSpecial(
                        DescriptorUtils.getFQName(LazyClassDescriptor.this))) {
                      return Collections.emptyList();
                    } else {
                      JetClassOrObject classOrObject =
                          declarationProvider.getOwnerInfo().getCorrespondingClassOrObject();
                      if (classOrObject == null) {
                        return Collections.emptyList();
                      } else {
                        List<JetType> allSupertypes =
                            resolveSession
                                .getInjector()
                                .getDescriptorResolver()
                                .resolveSupertypes(
                                    getScopeForClassHeaderResolution(),
                                    LazyClassDescriptor.this,
                                    classOrObject,
                                    resolveSession.getTrace());

                        return Lists.newArrayList(
                            Collections2.filter(allSupertypes, VALID_SUPERTYPE));
                      }
                    }
                  }
示例#3
0
  private WritableScope getDeclarationsScope(String path) throws IOException {
    ModuleDescriptor moduleDescriptor =
        LazyResolveTestUtil.resolveEagerly(
            Collections.singletonList(JetTestUtils.loadJetFile(getProject(), new File(path))),
            getEnvironment());

    NamespaceDescriptor testData = moduleDescriptor.getNamespace(new FqName("testData"));
    return addImports(testData.getMemberScope());
  }
示例#4
0
 @NotNull
 private List<AnnotationDescriptor> resolveAnnotations() {
   JetClassLikeInfo classInfo = declarationProvider.getOwnerInfo();
   JetModifierList modifierList = classInfo.getModifierList();
   if (modifierList != null) {
     AnnotationResolver annotationResolver = resolveSession.getInjector().getAnnotationResolver();
     JetScope scopeForDeclaration =
         getScopeProvider().getResolutionScopeForDeclaration(classInfo.getScopeAnchor());
     return annotationResolver.resolveAnnotationsWithArguments(
         scopeForDeclaration, modifierList, resolveSession.getTrace());
   } else {
     return Collections.emptyList();
   }
 }
示例#5
0
 @Override
 public List<AnnotationDescriptor> getAnnotations() {
   if (annotations == null) {
     JetClassLikeInfo classInfo = declarationProvider.getOwnerInfo();
     JetModifierList modifierList = classInfo.getModifierList();
     if (modifierList != null) {
       AnnotationResolver annotationResolver =
           resolveSession.getInjector().getAnnotationResolver();
       annotations =
           annotationResolver.resolveAnnotations(
               resolveSession.getResolutionScope(classInfo.getScopeAnchor()),
               modifierList,
               resolveSession.getTrace());
     } else {
       annotations = Collections.emptyList();
     }
   }
   return annotations;
 }
示例#6
0
 @Override
 public List<AnnotationDescriptor> getAnnotations() {
   return Collections.emptyList(); // TODO
 }
示例#7
0
 @Override
 public Collection<JetType> invoke(Boolean firstTime) {
   return Collections.emptyList();
 }