private void resolveAnonymousInitializers() { for (Map.Entry<JetClass, MutableClassDescriptor> entry : context.getClasses().entrySet()) { resolveAnonymousInitializers(entry.getKey(), entry.getValue()); } for (Map.Entry<JetObjectDeclaration, MutableClassDescriptor> entry : context.getObjects().entrySet()) { resolveAnonymousInitializers(entry.getKey(), entry.getValue()); } }
public void resolveBehaviorDeclarationBodies() { resolveDelegationSpecifierLists(); resolveClassAnnotations(); resolvePropertyDeclarationBodies(); resolveAnonymousInitializers(); resolvePrimaryConstructorParameters(); resolveSecondaryConstructorBodies(); resolveFunctionBodies(); if (!topDownAnalysisParameters.isDeclaredLocally()) { computeDeferredTypes(); } }
private static boolean initializerAdditionalResolve( ResolveSession resolveSession, JetClassInitializer classInitializer, DelegatingBindingTrace trace, JetFile file) { BodyResolver bodyResolver = createBodyResolverWithEmptyContext(trace, file, resolveSession.getModuleConfiguration()); JetClassOrObject classOrObject = PsiTreeUtil.getParentOfType(classInitializer, JetClassOrObject.class); LazyClassDescriptor classOrObjectDescriptor = (LazyClassDescriptor) resolveSession.resolveToDescriptor(classOrObject); bodyResolver.resolveAnonymousInitializers( classOrObject, classOrObjectDescriptor.getUnsubstitutedPrimaryConstructor(), classOrObjectDescriptor.getScopeForPropertyInitializerResolution()); return true; }