tests/cases/compiler/intersectionNotAssignableToConstituents.ts(15,3): error TS2322: Type 'B' is not assignable to type 'A'.
  Types have separate declarations of a private property 'x'.
tests/cases/compiler/intersectionNotAssignableToConstituents.ts(16,3): error TS2322: Type 'A' is not assignable to type 'B'.
  Types have separate declarations of a private property 'x'.
tests/cases/compiler/intersectionNotAssignableToConstituents.ts(17,3): error TS2322: Type 'A & B' is not assignable to type 'A'.
  Property 'x' has conflicting declarations and is inaccessible in type 'A & B'.
tests/cases/compiler/intersectionNotAssignableToConstituents.ts(18,3): error TS2322: Type 'A & B' is not assignable to type 'B'.
  Property 'x' has conflicting declarations and is inaccessible in type 'A & B'.


==== tests/cases/compiler/intersectionNotAssignableToConstituents.ts (4 errors) ====
    class A { private x: unknown }
    class B { private x: unknown }
    
    function f1(node: A | B) {
      if (node instanceof A || node instanceof A) {
        node;  // A
      }
      else {
        node;  // B
      }
      node;  // A | B
    }
    
    function f2(a: A, b: B, c: A & B) {
      a = b;  // Error
      ~
!!! error TS2322: Type 'B' is not assignable to type 'A'.
!!! error TS2322:   Types have separate declarations of a private property 'x'.
      b = a;  // Error
      ~
!!! error TS2322: Type 'A' is not assignable to type 'B'.
!!! error TS2322:   Types have separate declarations of a private property 'x'.
      a = c;  // Error (conflicting private fields)
      ~
!!! error TS2322: Type 'A & B' is not assignable to type 'A'.
!!! error TS2322:   Property 'x' has conflicting declarations and is inaccessible in type 'A & B'.
      b = c;  // Error (conflicting private fields)
      ~
!!! error TS2322: Type 'A & B' is not assignable to type 'B'.
!!! error TS2322:   Property 'x' has conflicting declarations and is inaccessible in type 'A & B'.
    }
    
    // Repro from #37659
    
    abstract class ViewNode { }
    abstract class ViewRefNode extends ViewNode { }
    abstract class ViewRefFileNode extends ViewRefNode { }
    
    class CommitFileNode extends ViewRefFileNode {
      private _id: any;
    }
    
    class ResultsFileNode extends ViewRefFileNode {
      private _id: any;
    }
    
    class StashFileNode extends CommitFileNode { 
      private _id2: any;
    }
    
    class StatusFileNode extends ViewNode {
      private _id: any;
    }
    
    class Foo {
      private async foo(node: CommitFileNode | ResultsFileNode | StashFileNode) {
    		if (
    			!(node instanceof CommitFileNode) &&
    			!(node instanceof StashFileNode) &&
    			!(node instanceof ResultsFileNode)
    		) {
    			return;
    		}
    
    		await this.bar(node);
    	}
    
      private async bar(node: CommitFileNode | ResultsFileNode | StashFileNode | StatusFileNode, options?: {}) {
        return Promise.resolve(undefined);
      }
    }
    