示例#1
0
  public JetScope getScopeForMemberDeclarationResolution() {
    if (scopeForMemberDeclarationResolution == null) {
      WritableScopeImpl scope =
          new WritableScopeImpl(
              JetScope.EMPTY,
              this,
              RedeclarationHandler.DO_NOTHING,
              "Member Declaration Resolution");
      scope.addLabeledDeclaration(this);
      scope.changeLockLevel(WritableScope.LockLevel.READING);

      scopeForMemberDeclarationResolution =
          new ChainedScope(
              this,
              getScopeForMemberLookup().getImplicitReceiver(),
              scope,
              getScopeForMemberLookup(),
              getScopeForClassHeaderResolution());
    }
    return scopeForMemberDeclarationResolution;
  }
示例#2
0
  @NotNull
  private JetScope computeScopeForMemberDeclarationResolution() {
    WritableScopeImpl thisScope =
        new WritableScopeImpl(
            JetScope.EMPTY,
            this,
            RedeclarationHandler.DO_NOTHING,
            "Scope with 'this' for " + getName());
    thisScope.addLabeledDeclaration(this);
    thisScope.changeLockLevel(WritableScope.LockLevel.READING);

    ClassDescriptor classObject = getClassObjectDescriptor();
    JetScope classObjectAdapterScope =
        (classObject != null) ? new ClassObjectMixinScope(classObject) : JetScope.EMPTY;

    return new ChainedScope(
        this,
        "ScopeForMemberDeclarationResolution: " + getName(),
        thisScope,
        getScopeForMemberLookup(),
        getScopeForClassHeaderResolution(),
        classObjectAdapterScope);
  }