title: F# compiler requires project reference, but method is private
body: <p>The F# compiler gives an error saying I must add a project reference because the type I'm using has a method argument that lives in that project. <em>But this method is private!</em></p>
  
  <p>I have the following project structure:</p>
  
  <p><em>Program -> Library -> SubLibrary</em></p>
  
  <p><em>SubLibrary</em> contains this:</p>
  
  <pre><code>namespace SubLibrary
  
  type Widget = { Value: int }
  </code></pre>
  
  <p><em>Library</em> contains this:</p>
  
  <pre><code>namespace Library
  
  open SubLibrary
  
  type Banana =
      { Value: int }
  
      member private x.TakeWidget (w: Widget) = ()
  </code></pre>
  
  <p><em>Program</em> contains this:</p>
  
  <pre><code>open Library
  
  [&lt;EntryPoint&gt;]
  let main argv = 
      printfn "%A" argv
  
      let banana = { Value = 42 }
      0
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>error FS0074:
  The type referenced through 'SubLibrary.Widget' is defined in an assembly that is not referenced.
  You must add a reference to assembly 'SubLibrary'
  </code></pre>
  
  <p>But the <code>TakeWidget</code> method is <em>private</em>!</p>
  
  <p>I tried changing <code>Banana</code> into a class, rather than a record, but that made no difference.</p>
  
  <p>As an experiment, I created a C# version of <em>Library</em>, called <em>CLibrary</em>:</p>
  
  <pre><code>using SubLibrary;
  
  namespace CLibrary {
      public class CBanana {
          int m_value;
  
          public CBanana(int value) {
              m_value = value;
          }
  
          private void TakeWidget(Widget w) {
          }
      }
  }
  </code></pre>
  
  <p>Then I changed <em>Program</em> to use <code>CBanana</code> instead of <code>Banana</code>:</p>
  
  <pre><code>open Library
  
  [&lt;EntryPoint&gt;]
  let main argv = 
      printfn "%A" argv
  
      let banana = CBanana 42
      0
  </code></pre>
  
  <p>Now I don't get an error. In fact, with C# I can make that method public, and so long as I don't try to compile a call to it, there is no error.</p>
  
  <p>Why is the compiler insisting I add a reference to SubLibrary? Sure, I could just go ahead and do what it tells me to do, for a quiet life, but <em>SubLibrary</em> is a private implementation detail of <em>Library</em>, which should not be exposed to <em>Program</em>.</p>