public MutableClassDescriptor(
      @NotNull DeclarationDescriptor containingDeclaration,
      @NotNull JetScope outerScope,
      @NotNull ClassKind kind,
      boolean isInner,
      @NotNull Name name,
      @NotNull SourceElement source) {
    super(LockBasedStorageManager.NO_LOCKS, containingDeclaration, name, source);
    this.kind = kind;
    this.isInner = isInner;

    RedeclarationHandler redeclarationHandler = RedeclarationHandler.DO_NOTHING;

    setScopeForMemberLookup(
        new WritableScopeImpl(JetScope.EMPTY, this, redeclarationHandler, "MemberLookup")
            .changeLockLevel(WritableScope.LockLevel.BOTH));
    this.scopeForSupertypeResolution =
        new WritableScopeImpl(outerScope, this, redeclarationHandler, "SupertypeResolution")
            .changeLockLevel(WritableScope.LockLevel.BOTH);
    this.scopeForMemberResolution =
        new WritableScopeImpl(
                scopeForSupertypeResolution, this, redeclarationHandler, "MemberResolution")
            .changeLockLevel(WritableScope.LockLevel.BOTH);

    if (kind == ClassKind.TRAIT) {
      setUpScopeForInitializers(this);
    }

    scopeForMemberResolution.importScope(staticScope);
    scopeForMemberResolution.addLabeledDeclaration(this);
  }