Exemplo n.º 1
0
  private WritableScope getDeclarationsScope(String path) throws IOException {
    ModuleDescriptor moduleDescriptor =
        LazyResolveTestUtil.resolveEagerly(
            Collections.singletonList(JetTestUtils.loadJetFile(getProject(), new File(path))),
            getEnvironment());

    NamespaceDescriptor testData = moduleDescriptor.getNamespace(new FqName("testData"));
    return addImports(testData.getMemberScope());
  }
Exemplo n.º 2
0
 @Override
 protected boolean isVisible(
     @NotNull DeclarationDescriptorWithVisibility what,
     @NotNull DeclarationDescriptor from) {
   ModuleDescriptor parentModule =
       DescriptorUtils.getParentOfType(what, ModuleDescriptor.class, false);
   ModuleDescriptor fromModule =
       DescriptorUtils.getParentOfType(from, ModuleDescriptor.class, false);
   assert parentModule != null && fromModule != null;
   return parentModule.equals(fromModule);
 }
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    PackageViewDescriptorImpl that = (PackageViewDescriptorImpl) o;

    if (!fqName.equals(that.fqName)) return false;
    if (!module.equals(that.module)) return false;

    return true;
  }
  @Test
  public void testJetStandardLibrary() throws Exception {
    List<JetFile> files = Lists.newArrayList();
    addJetFilesFromDir(files, new File("compiler/frontend/src/jet"));

    final Map<FqName, Name> aliases =
        ImmutableMap.<FqName, Name>builder()
            .put(new FqName("jet.Unit"), Name.identifier("Tuple0"))
            .build();

    ModuleDescriptor lazyModule = new ModuleDescriptor(Name.special("<lazy module>"));
    ResolveSession session =
        new ResolveSession(
            getProject(),
            lazyModule,
            new SpecialModuleConfiguration(),
            new FileBasedDeclarationProviderFactory(files),
            new Function<FqName, Name>() {
              @Override
              public Name fun(FqName name) {
                return aliases.get(name);
              }
            },
            Predicates.in(
                Sets.newHashSet(new FqNameUnsafe("jet.Any"), new FqNameUnsafe("jet.Nothing"))),
            new BindingTraceContext());

    NamespaceDescriptor jetNamespaceFromJSL =
        (NamespaceDescriptor) KotlinBuiltIns.getInstance().getInt().getContainingDeclaration();
    NamespaceDescriptor jetNamespaceFromLazy =
        lazyModule.getRootNamespace().getMemberScope().getNamespace(jetNamespaceFromJSL.getName());

    NamespaceComparator.compareNamespaces(
        jetNamespaceFromJSL,
        jetNamespaceFromLazy,
        NamespaceComparator.RECURSIVE,
        new File("compiler/testData/builtin-classes.txt"));
  }
  public PackageViewDescriptorImpl(
      @NotNull ModuleDescriptor module,
      @NotNull FqName fqName,
      @NotNull List<PackageFragmentDescriptor> fragments) {
    super(Collections.<AnnotationDescriptor>emptyList(), fqName.shortNameOrSpecial());
    this.module = module;
    this.fqName = fqName;

    List<JetScope> scopes = Lists.newArrayList();
    assert !fragments.isEmpty() : fqName + " in " + module;
    for (PackageFragmentDescriptor fragment : fragments) {
      scopes.add(fragment.getMemberScope());
    }
    scopes.add(new SubpackagesScope());

    memberScope =
        new ChainedScope(
            this,
            "package view scope for " + fqName + " in " + module.getName(),
            scopes.toArray(new JetScope[scopes.size()]));
  }
  public EclipseInjectorForTopDownAnalyzerForJvm(
      @NotNull Project project,
      @NotNull GlobalContext globalContext,
      @NotNull BindingTrace bindingTrace,
      @NotNull ModuleDescriptor moduleDescriptor,
      @NotNull IJavaProject IJavaProject) {
    this.project = project;
    this.globalContext = globalContext;
    this.storageManager = globalContext.getStorageManager();
    this.bindingTrace = bindingTrace;
    this.moduleDescriptor = moduleDescriptor;
    this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
    this.IJavaProject = IJavaProject;
    this.topDownAnalyzer = new TopDownAnalyzer();
    this.lazyTopDownAnalyzer = new LazyTopDownAnalyzer();
    this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(getModuleDescriptor());
    this.eclipseJavaClassFinder = new EclipseJavaClassFinder();
    this.virtualFileFinder =
        org.jetbrains.jet.lang.resolve.kotlin.VirtualFileFinder.SERVICE.getInstance(project);
    this.deserializedDescriptorResolver = new DeserializedDescriptorResolver();
    this.eclipseExternalAnnotationResolver = new EclipseExternalAnnotationResolver();
    this.traceBasedExternalSignatureResolver = new TraceBasedExternalSignatureResolver();
    this.traceBasedErrorReporter = new TraceBasedErrorReporter();
    this.eclipseMethodSignatureChecker = new EclipseMethodSignatureChecker();
    this.eclipseTraceBasedJavaResolverCache = new EclipseTraceBasedJavaResolverCache();
    this.eclipseJavaPropertyInitializerEvaluator = new EclipseJavaPropertyInitializerEvaluator();
    this.eclipseJavaSourceElementFactory = new EclipseJavaSourceElementFactory();
    this.singleModuleClassResolver = new SingleModuleClassResolver();
    this.globalJavaResolverContext =
        new GlobalJavaResolverContext(
            storageManager,
            eclipseJavaClassFinder,
            virtualFileFinder,
            deserializedDescriptorResolver,
            eclipseExternalAnnotationResolver,
            traceBasedExternalSignatureResolver,
            traceBasedErrorReporter,
            eclipseMethodSignatureChecker,
            eclipseTraceBasedJavaResolverCache,
            eclipseJavaPropertyInitializerEvaluator,
            eclipseJavaSourceElementFactory,
            singleModuleClassResolver);
    this.lazyJavaPackageFragmentProvider =
        new LazyJavaPackageFragmentProvider(globalJavaResolverContext, getModuleDescriptor());
    this.javaDescriptorResolver =
        new JavaDescriptorResolver(lazyJavaPackageFragmentProvider, getModuleDescriptor());
    this.javaClassDataFinder =
        new JavaClassDataFinder(virtualFileFinder, deserializedDescriptorResolver);
    this.annotationDescriptorLoader = new AnnotationDescriptorLoader();
    this.constantDescriptorLoader = new ConstantDescriptorLoader();
    this.deserializationGlobalContextForJava =
        new DeserializationGlobalContextForJava(
            storageManager,
            getModuleDescriptor(),
            javaClassDataFinder,
            annotationDescriptorLoader,
            constantDescriptorLoader,
            lazyJavaPackageFragmentProvider);
    this.additionalCheckerProvider =
        org.jetbrains.jet.lang.resolve.kotlin.JavaDeclarationCheckerProvider.INSTANCE$;
    this.bodyResolver = new BodyResolver();
    this.annotationResolver = new AnnotationResolver();
    this.callResolver = new CallResolver();
    this.argumentTypeResolver = new ArgumentTypeResolver();
    this.expressionTypingComponents = new ExpressionTypingComponents();
    this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
    this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices);
    this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver);
    this.forLoopConventionsChecker = new ForLoopConventionsChecker();
    this.reflectionTypes = new ReflectionTypes(getModuleDescriptor());
    this.callExpressionResolver = new CallExpressionResolver();
    this.descriptorResolver = new DescriptorResolver();
    this.delegatedPropertyResolver = new DelegatedPropertyResolver();
    this.typeResolver = new TypeResolver();
    this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
    this.callResolverExtensionProvider = new CallResolverExtensionProvider();
    this.candidateResolver = new CandidateResolver();
    this.callCompleter = new CallCompleter(argumentTypeResolver, candidateResolver);
    this.controlFlowAnalyzer = new ControlFlowAnalyzer();
    this.declarationsChecker = new DeclarationsChecker();
    this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
    this.scriptBodyResolver = new ScriptBodyResolver();
    this.declarationResolver = new DeclarationResolver();
    this.importsResolver = new ImportsResolver();
    this.jetImportsFactory = new JetImportsFactory();
    this.overloadResolver = new OverloadResolver();
    this.overrideResolver = new OverrideResolver();
    this.typeHierarchyResolver = new TypeHierarchyResolver();
    this.scriptHeaderResolver = new ScriptHeaderResolver();
    this.descriptorLoadersStorage = new DescriptorLoadersStorage(storageManager);

    this.topDownAnalyzer.setAdditionalCheckerProvider(additionalCheckerProvider);
    this.topDownAnalyzer.setBodyResolver(bodyResolver);
    this.topDownAnalyzer.setDeclarationResolver(declarationResolver);
    this.topDownAnalyzer.setLazyTopDownAnalyzer(lazyTopDownAnalyzer);
    this.topDownAnalyzer.setModuleDescriptor(moduleDescriptor);
    this.topDownAnalyzer.setOverloadResolver(overloadResolver);
    this.topDownAnalyzer.setOverrideResolver(overrideResolver);
    this.topDownAnalyzer.setPackageFragmentProvider(mutablePackageFragmentProvider);
    this.topDownAnalyzer.setProject(project);
    this.topDownAnalyzer.setTrace(bindingTrace);
    this.topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver);

    this.lazyTopDownAnalyzer.setBodyResolver(bodyResolver);
    this.lazyTopDownAnalyzer.setDeclarationResolver(declarationResolver);
    this.lazyTopDownAnalyzer.setModuleDescriptor(moduleDescriptor);
    this.lazyTopDownAnalyzer.setOverloadResolver(overloadResolver);
    this.lazyTopDownAnalyzer.setOverrideResolver(overrideResolver);
    this.lazyTopDownAnalyzer.setTrace(bindingTrace);

    eclipseJavaClassFinder.setProjectScope(IJavaProject);

    traceBasedExternalSignatureResolver.setExternalAnnotationResolver(
        eclipseExternalAnnotationResolver);
    traceBasedExternalSignatureResolver.setProject(project);
    traceBasedExternalSignatureResolver.setTrace(bindingTrace);

    eclipseTraceBasedJavaResolverCache.setTrace(bindingTrace);

    traceBasedErrorReporter.setTrace(bindingTrace);

    singleModuleClassResolver.setResolver(javaDescriptorResolver);

    bodyResolver.setAnnotationResolver(annotationResolver);
    bodyResolver.setCallResolver(callResolver);
    bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
    bodyResolver.setDeclarationsChecker(declarationsChecker);
    bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    bodyResolver.setExpressionTypingServices(expressionTypingServices);
    bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
    bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
    bodyResolver.setTrace(bindingTrace);

    annotationResolver.setCallResolver(callResolver);
    annotationResolver.setStorageManager(storageManager);
    annotationResolver.setTypeResolver(typeResolver);

    callResolver.setArgumentTypeResolver(argumentTypeResolver);
    callResolver.setCallCompleter(callCompleter);
    callResolver.setCandidateResolver(candidateResolver);
    callResolver.setExpressionTypingServices(expressionTypingServices);
    callResolver.setTypeResolver(typeResolver);

    argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
    argumentTypeResolver.setTypeResolver(typeResolver);

    expressionTypingServices.setAnnotationResolver(annotationResolver);
    expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
    expressionTypingServices.setCallResolver(callResolver);
    expressionTypingServices.setDescriptorResolver(descriptorResolver);
    expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
    expressionTypingServices.setProject(project);
    expressionTypingServices.setTypeResolver(typeResolver);

    expressionTypingComponents.setAdditionalCheckerProvider(additionalCheckerProvider);
    expressionTypingComponents.setCallResolver(callResolver);
    expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
    expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
    expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
    expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
    expressionTypingComponents.setGlobalContext(globalContext);
    expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
    expressionTypingComponents.setReflectionTypes(reflectionTypes);

    forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
    forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
    forLoopConventionsChecker.setProject(project);

    callExpressionResolver.setExpressionTypingServices(expressionTypingServices);

    descriptorResolver.setAnnotationResolver(annotationResolver);
    descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    descriptorResolver.setExpressionTypingServices(expressionTypingServices);
    descriptorResolver.setStorageManager(storageManager);
    descriptorResolver.setTypeResolver(typeResolver);

    delegatedPropertyResolver.setCallResolver(callResolver);
    delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);

    typeResolver.setAnnotationResolver(annotationResolver);
    typeResolver.setModuleDescriptor(moduleDescriptor);
    typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);

    candidateResolver.setArgumentTypeResolver(argumentTypeResolver);

    controlFlowAnalyzer.setTrace(bindingTrace);

    declarationsChecker.setAdditionalCheckerProvider(additionalCheckerProvider);
    declarationsChecker.setDescriptorResolver(descriptorResolver);
    declarationsChecker.setTrace(bindingTrace);

    functionAnalyzerExtension.setTrace(bindingTrace);

    scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);

    declarationResolver.setAnnotationResolver(annotationResolver);
    declarationResolver.setDescriptorResolver(descriptorResolver);
    declarationResolver.setImportsResolver(importsResolver);
    declarationResolver.setTrace(bindingTrace);

    importsResolver.setImportsFactory(jetImportsFactory);
    importsResolver.setModuleDescriptor(moduleDescriptor);
    importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
    importsResolver.setTrace(bindingTrace);

    jetImportsFactory.setProject(project);

    overloadResolver.setTrace(bindingTrace);

    overrideResolver.setTrace(bindingTrace);

    typeHierarchyResolver.setDescriptorResolver(descriptorResolver);
    typeHierarchyResolver.setImportsResolver(importsResolver);
    typeHierarchyResolver.setPackageFragmentProvider(mutablePackageFragmentProvider);
    typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver);
    typeHierarchyResolver.setTrace(bindingTrace);

    scriptHeaderResolver.setPackageFragmentProvider(mutablePackageFragmentProvider);
    scriptHeaderResolver.setTrace(bindingTrace);

    deserializedDescriptorResolver.setContext(deserializationGlobalContextForJava);
    deserializedDescriptorResolver.setErrorReporter(traceBasedErrorReporter);

    annotationDescriptorLoader.setErrorReporter(traceBasedErrorReporter);
    annotationDescriptorLoader.setKotlinClassFinder(virtualFileFinder);
    annotationDescriptorLoader.setModule(moduleDescriptor);
    annotationDescriptorLoader.setStorage(descriptorLoadersStorage);

    descriptorLoadersStorage.setErrorReporter(traceBasedErrorReporter);
    descriptorLoadersStorage.setModule(moduleDescriptor);

    constantDescriptorLoader.setErrorReporter(traceBasedErrorReporter);
    constantDescriptorLoader.setKotlinClassFinder(virtualFileFinder);
    constantDescriptorLoader.setStorage(descriptorLoadersStorage);
  }
Exemplo n.º 7
0
  public InjectorForTests(@NotNull Project project, @NotNull ModuleDescriptor moduleDescriptor) {
    this.project = project;
    this.moduleDescriptor = moduleDescriptor;
    this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
    this.descriptorResolver = new DescriptorResolver();
    this.expressionTypingComponents = new ExpressionTypingComponents();
    this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
    this.callResolver = new CallResolver();
    this.expressionTypingUtils =
        new ExpressionTypingUtils(getExpressionTypingServices(), callResolver);
    this.typeResolver = new TypeResolver();
    this.globalContext = org.jetbrains.jet.context.ContextPackage.GlobalContext();
    this.storageManager = globalContext.getStorageManager();
    this.annotationResolver = new AnnotationResolver();
    this.argumentTypeResolver = new ArgumentTypeResolver();
    this.candidateResolver = new CandidateResolver();
    this.delegatedPropertyResolver = new DelegatedPropertyResolver();
    this.controlStructureTypingUtils =
        new ControlStructureTypingUtils(getExpressionTypingServices());
    this.forLoopConventionsChecker = new ForLoopConventionsChecker();
    this.reflectionTypes = new ReflectionTypes(moduleDescriptor);
    this.callExpressionResolver = new CallExpressionResolver();
    this.callResolverExtensionProvider = new CallResolverExtensionProvider();
    this.qualifiedExpressionResolver = new QualifiedExpressionResolver();

    this.descriptorResolver.setAnnotationResolver(annotationResolver);
    this.descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    this.descriptorResolver.setExpressionTypingServices(expressionTypingServices);
    this.descriptorResolver.setStorageManager(storageManager);
    this.descriptorResolver.setTypeResolver(typeResolver);

    this.expressionTypingServices.setAnnotationResolver(annotationResolver);
    this.expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
    this.expressionTypingServices.setCallResolver(callResolver);
    this.expressionTypingServices.setDescriptorResolver(descriptorResolver);
    this.expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
    this.expressionTypingServices.setProject(project);
    this.expressionTypingServices.setTypeResolver(typeResolver);

    this.typeResolver.setAnnotationResolver(annotationResolver);
    this.typeResolver.setModuleDescriptor(moduleDescriptor);
    this.typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);

    annotationResolver.setCallResolver(callResolver);
    annotationResolver.setStorageManager(storageManager);
    annotationResolver.setTypeResolver(typeResolver);

    callResolver.setArgumentTypeResolver(argumentTypeResolver);
    callResolver.setCandidateResolver(candidateResolver);
    callResolver.setExpressionTypingServices(expressionTypingServices);
    callResolver.setTypeResolver(typeResolver);

    argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
    argumentTypeResolver.setTypeResolver(typeResolver);

    candidateResolver.setArgumentTypeResolver(argumentTypeResolver);

    delegatedPropertyResolver.setCallResolver(callResolver);
    delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);

    expressionTypingComponents.setCallResolver(callResolver);
    expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
    expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
    expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
    expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
    expressionTypingComponents.setGlobalContext(globalContext);
    expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
    expressionTypingComponents.setReflectionTypes(reflectionTypes);

    forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
    forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
    forLoopConventionsChecker.setProject(project);

    callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
  }
 @Nullable
 @Override
 public PackageViewDescriptor getContainingDeclaration() {
   return fqName.isRoot() ? null : module.getPackage(fqName.parent());
 }
 @Override
 public int hashCode() {
   int result = module.hashCode();
   result = 31 * result + fqName.hashCode();
   return result;
 }
  public InjectorForBodyResolve(
      @NotNull Project project,
      @NotNull GlobalContext globalContext,
      @NotNull BindingTrace bindingTrace,
      @NotNull ModuleDescriptor moduleDescriptor) {
    this.project = project;
    this.globalContext = globalContext;
    this.storageManager = globalContext.getStorageManager();
    this.bindingTrace = bindingTrace;
    this.moduleDescriptor = moduleDescriptor;
    this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
    this.bodyResolver = new BodyResolver();
    this.annotationResolver = new AnnotationResolver();
    this.callResolver = new CallResolver();
    this.argumentTypeResolver = new ArgumentTypeResolver();
    this.expressionTypingComponents = new ExpressionTypingComponents();
    this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
    this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices);
    this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver);
    this.forLoopConventionsChecker = new ForLoopConventionsChecker();
    this.reflectionTypes = new ReflectionTypes(moduleDescriptor);
    this.callExpressionResolver = new CallExpressionResolver();
    this.descriptorResolver = new DescriptorResolver();
    this.delegatedPropertyResolver = new DelegatedPropertyResolver();
    this.typeResolver = new TypeResolver();
    this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
    this.callResolverExtensionProvider = new CallResolverExtensionProvider();
    this.candidateResolver = new CandidateResolver();
    this.callCompleter = new CallCompleter(argumentTypeResolver, candidateResolver);
    this.controlFlowAnalyzer = new ControlFlowAnalyzer();
    this.declarationsChecker = new DeclarationsChecker();
    this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
    this.scriptBodyResolver = new ScriptBodyResolver();

    this.bodyResolver.setAnnotationResolver(annotationResolver);
    this.bodyResolver.setCallResolver(callResolver);
    this.bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
    this.bodyResolver.setDeclarationsChecker(declarationsChecker);
    this.bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    this.bodyResolver.setExpressionTypingServices(expressionTypingServices);
    this.bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
    this.bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
    this.bodyResolver.setTrace(bindingTrace);

    annotationResolver.setCallResolver(callResolver);
    annotationResolver.setStorageManager(storageManager);
    annotationResolver.setTypeResolver(typeResolver);

    callResolver.setArgumentTypeResolver(argumentTypeResolver);
    callResolver.setCallCompleter(callCompleter);
    callResolver.setCandidateResolver(candidateResolver);
    callResolver.setExpressionTypingServices(expressionTypingServices);
    callResolver.setTypeResolver(typeResolver);

    argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
    argumentTypeResolver.setTypeResolver(typeResolver);

    expressionTypingServices.setAnnotationResolver(annotationResolver);
    expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
    expressionTypingServices.setCallResolver(callResolver);
    expressionTypingServices.setDescriptorResolver(descriptorResolver);
    expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
    expressionTypingServices.setProject(project);
    expressionTypingServices.setTypeResolver(typeResolver);

    expressionTypingComponents.setCallResolver(callResolver);
    expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
    expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
    expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
    expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
    expressionTypingComponents.setGlobalContext(globalContext);
    expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
    expressionTypingComponents.setReflectionTypes(reflectionTypes);

    forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
    forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
    forLoopConventionsChecker.setProject(project);

    callExpressionResolver.setExpressionTypingServices(expressionTypingServices);

    descriptorResolver.setAnnotationResolver(annotationResolver);
    descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
    descriptorResolver.setExpressionTypingServices(expressionTypingServices);
    descriptorResolver.setStorageManager(storageManager);
    descriptorResolver.setTypeResolver(typeResolver);

    delegatedPropertyResolver.setCallResolver(callResolver);
    delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);

    typeResolver.setAnnotationResolver(annotationResolver);
    typeResolver.setModuleDescriptor(moduleDescriptor);
    typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);

    candidateResolver.setArgumentTypeResolver(argumentTypeResolver);

    controlFlowAnalyzer.setTrace(bindingTrace);

    declarationsChecker.setDescriptorResolver(descriptorResolver);
    declarationsChecker.setTrace(bindingTrace);

    functionAnalyzerExtension.setTrace(bindingTrace);

    scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
  }