コード例 #1
0
ファイル: BodyResolver.java プロジェクト: raph-amiard/kotlin
 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
ファイル: BodyResolver.java プロジェクト: raph-amiard/kotlin
  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;
  }