Пример #1
0
 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());
   }
 }
Пример #2
0
  public void resolveBehaviorDeclarationBodies() {

    resolveDelegationSpecifierLists();
    resolveClassAnnotations();

    resolvePropertyDeclarationBodies();
    resolveAnonymousInitializers();
    resolvePrimaryConstructorParameters();

    resolveSecondaryConstructorBodies();
    resolveFunctionBodies();

    if (!topDownAnalysisParameters.isDeclaredLocally()) {
      computeDeferredTypes();
    }
  }
Пример #3
0
  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;
  }