Ejemplo n.º 1
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;
  }
Ejemplo n.º 2
0
  private static void delegationSpecifierAdditionalResolve(
      final ResolveSession resolveSession,
      final JetDelegationSpecifierList specifier,
      DelegatingBindingTrace trace,
      JetFile file) {
    BodyResolver bodyResolver =
        createBodyResolverWithEmptyContext(trace, file, resolveSession.getModuleConfiguration());

    JetClassOrObject classOrObject = (JetClassOrObject) specifier.getParent();
    LazyClassDescriptor descriptor =
        (LazyClassDescriptor) resolveSession.resolveToDescriptor(classOrObject);

    // Activate resolving of supertypes
    descriptor.getTypeConstructor().getSupertypes();

    bodyResolver.resolveDelegationSpecifierList(
        classOrObject,
        descriptor,
        descriptor.getUnsubstitutedPrimaryConstructor(),
        descriptor.getScopeForClassHeaderResolution(),
        descriptor.getScopeForMemberDeclarationResolution());
  }