@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; }
@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)); } } }
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()); }
@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(); } }
@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; }
@Override public List<AnnotationDescriptor> getAnnotations() { return Collections.emptyList(); // TODO }
@Override public Collection<JetType> invoke(Boolean firstTime) { return Collections.emptyList(); }