title: Error: a type annotation may be needed
body: <p>I am trying to have Name return the value of item.name where item is an instance of a C# class.</p>
  
  <p>the fs file contains</p>
  
  
  
  <pre class="lang-ml prettyprint-override"><code>namespace PatternMatch
  
  type PatternMatch() = 
      member this.X = "F#"
  
  namespace Items_
  </code></pre>
  
  <p>the fsx file contains</p>
  
  <pre class="lang-ml prettyprint-override"><code>#load "PatternMatch.fs"
  open PatternMatch
  
  open Items_
  
  type item = Item
  
  let Name item = item.name //this line throws the error
  
  let rec sentence s item  = function
      | s when s="Action" -&gt; ""
      | s when s="Client" -&gt; ""
      | s when s="Classifier" -&gt; ""    
      | s when s="Container" -&gt; ""    
      | s when s="ControlFlow" -&gt; ""
      | s when s="Gaurd" -&gt; ""
      | s when s="Name" -&gt; Name item
      | s when s="ObjectFlow" -&gt; ""    
      | s when s="Source" -&gt; ""    
      | _ -&gt; ""
  </code></pre>
  
  <p><code>let Name item = item.name</code> throws the error. 
  <code>Items_</code> is a C# namespace and <code>Item</code> is a C# class within.</p>
  
  <p>The entire error is:</p>
  
  <blockquote>
    <p>Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.    C:\Users\jzbedocs\Local Files\Visual Studio 2010\Projects\addin\trunk\PatternMatch\Script.fsx   11  17  PatternMatch</p>
  </blockquote>