private void resolvePropertyDeclarationBodies(@NotNull BodiesResolveContext c) { // Member properties Set<JetProperty> processed = Sets.newHashSet(); for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry : c.getDeclaredClasses().entrySet()) { if (!(entry.getKey() instanceof JetClass)) continue; JetClass jetClass = (JetClass) entry.getKey(); ClassDescriptorWithResolutionScopes classDescriptor = entry.getValue(); for (JetProperty property : jetClass.getProperties()) { PropertyDescriptor propertyDescriptor = c.getProperties().get(property); assert propertyDescriptor != null; resolveProperty( c, classDescriptor.getScopeForMemberDeclarationResolution(), property, propertyDescriptor); processed.add(property); } } // Top-level properties & properties of objects for (Map.Entry<JetProperty, PropertyDescriptor> entry : c.getProperties().entrySet()) { JetProperty property = entry.getKey(); if (processed.contains(property)) continue; PropertyDescriptor propertyDescriptor = entry.getValue(); resolveProperty(c, null, property, propertyDescriptor); } }
public void process(@NotNull BodiesResolveContext bodiesResolveContext) { for (JetFile file : bodiesResolveContext.getFiles()) { checkModifiersAndAnnotationsInPackageDirective(file); AnnotationTargetChecker.INSTANCE$.check(file, trace); } Map<JetClassOrObject, ClassDescriptorWithResolutionScopes> classes = bodiesResolveContext.getDeclaredClasses(); for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry : classes.entrySet()) { JetClassOrObject classOrObject = entry.getKey(); ClassDescriptorWithResolutionScopes classDescriptor = entry.getValue(); checkSupertypesForConsistency(classDescriptor); checkTypesInClassHeader(classOrObject); if (classOrObject instanceof JetClass) { JetClass jetClass = (JetClass) classOrObject; checkClass(bodiesResolveContext, jetClass, classDescriptor); descriptorResolver.checkNamesInConstraints( jetClass, classDescriptor, classDescriptor.getScopeForClassHeaderResolution(), trace); } else if (classOrObject instanceof JetObjectDeclaration) { checkObject((JetObjectDeclaration) classOrObject, classDescriptor); } checkPrimaryConstructor(classOrObject, classDescriptor); modifiersChecker.checkModifiersForDeclaration(classOrObject, classDescriptor); } Map<JetNamedFunction, SimpleFunctionDescriptor> functions = bodiesResolveContext.getFunctions(); for (Map.Entry<JetNamedFunction, SimpleFunctionDescriptor> entry : functions.entrySet()) { JetNamedFunction function = entry.getKey(); SimpleFunctionDescriptor functionDescriptor = entry.getValue(); checkFunction(function, functionDescriptor); modifiersChecker.checkModifiersForDeclaration(function, functionDescriptor); } Map<JetProperty, PropertyDescriptor> properties = bodiesResolveContext.getProperties(); for (Map.Entry<JetProperty, PropertyDescriptor> entry : properties.entrySet()) { JetProperty property = entry.getKey(); PropertyDescriptor propertyDescriptor = entry.getValue(); checkProperty(property, propertyDescriptor); modifiersChecker.checkModifiersForDeclaration(property, propertyDescriptor); } for (Map.Entry<JetSecondaryConstructor, ConstructorDescriptor> entry : bodiesResolveContext.getSecondaryConstructors().entrySet()) { ConstructorDescriptor constructorDescriptor = entry.getValue(); JetSecondaryConstructor declaration = entry.getKey(); checkConstructorDeclaration(constructorDescriptor, declaration); } }