Exemplo n.º 1
0
  private void resolveFunctionAndPropertyHeaders() {
    for (Map.Entry<JetFile, WritableScope> entry : context.getNamespaceScopes().entrySet()) {
      JetFile namespace = entry.getKey();
      WritableScope namespaceScope = entry.getValue();
      NamespaceLike namespaceDescriptor = context.getNamespaceDescriptors().get(namespace);

      resolveFunctionAndPropertyHeaders(
          namespace.getDeclarations(),
          namespaceScope,
          namespaceScope,
          namespaceScope,
          namespaceDescriptor);
    }
    for (Map.Entry<JetClass, MutableClassDescriptor> entry : context.getClasses().entrySet()) {
      JetClass jetClass = entry.getKey();
      MutableClassDescriptor classDescriptor = entry.getValue();

      resolveFunctionAndPropertyHeaders(
          jetClass.getDeclarations(),
          classDescriptor.getScopeForMemberResolution(),
          classDescriptor.getScopeForInitializers(),
          classDescriptor.getScopeForMemberResolution(),
          classDescriptor);
      //            processPrimaryConstructor(classDescriptor, jetClass);
      //            for (JetSecondaryConstructor jetConstructor :
      // jetClass.getSecondaryConstructors()) {
      //                processSecondaryConstructor(classDescriptor, jetConstructor);
      //            }
    }
    for (Map.Entry<JetObjectDeclaration, MutableClassDescriptor> entry :
        context.getObjects().entrySet()) {
      JetObjectDeclaration object = entry.getKey();
      MutableClassDescriptor classDescriptor = entry.getValue();

      resolveFunctionAndPropertyHeaders(
          object.getDeclarations(),
          classDescriptor.getScopeForMemberResolution(),
          classDescriptor.getScopeForInitializers(),
          classDescriptor.getScopeForMemberResolution(),
          classDescriptor);
    }

    // TODO : Extensions
  }