예제 #1
0
  private void resolveBehaviorDeclarationBodies(@NotNull BodiesResolveContext c) {
    resolveDelegationSpecifierLists(c);

    resolvePropertyDeclarationBodies(c);

    resolveAnonymousInitializers(c);
    resolvePrimaryConstructorParameters(c);
    resolveSecondaryConstructors(c);

    resolveFunctionBodies(c);

    // SCRIPT: resolve script bodies
    scriptBodyResolverResolver.resolveScriptBodies(c);

    if (!c.getTopDownAnalysisMode().getIsLocalDeclarations()) {
      computeDeferredTypes();
    }
  }
예제 #2
0
  private void resolveFunctionBodies(@NotNull BodiesResolveContext c) {
    for (Map.Entry<JetNamedFunction, SimpleFunctionDescriptor> entry :
        c.getFunctions().entrySet()) {
      JetNamedFunction declaration = entry.getKey();

      LexicalScope scope = c.getDeclaringScope(declaration);
      assert scope != null
          : "Scope is null: " + PsiUtilPackage.getElementTextWithContext(declaration);

      if (!c.getTopDownAnalysisMode().getIsLocalDeclarations()
          && !(bodyResolveCache instanceof BodyResolveCache.ThrowException)
          && expressionTypingServices.getStatementFilter() != StatementFilter.NONE) {
        bodyResolveCache.resolveFunctionBody(declaration).addOwnDataTo(trace, true);
      } else {
        resolveFunctionBody(c.getOuterDataFlowInfo(), trace, declaration, entry.getValue(), scope);
      }
    }
  }