title: VB.Net & type inferencing in lambda expressions?
body: <p>I have a type lets call it "MyType". I have a List(Of MyType). Here is what i'm doing:  </p>
  
  <pre><code>MyList.Sum(Function(x) x.MyFieldToTotal)
  </code></pre>
  
  <p>"MyFieldToTotal" is a decimal. For the life of me i can't figure out why x above is an object rather than a type of "MyType". Shouldn't Type Inferencing be working in this case? Even in intellisense i get "selector as System.Func(Of MyType) as Decimal" </p>
  
  <p>To test the differences between C# &amp; vb.net i did the following:</p>
  
  <pre><code>dim MyVar as new list(Of System.IO.FileStream)
  MyVar.Sum(Function(x) x.
  
  List&lt;System.IO.FileStream&gt; MyVar = new List&lt;System.IO.FileStream&gt;();
  MyVar.Sum(x=&gt;x.
  </code></pre>
  
  <p>In VB.Net x was of type Object while in C# x was of type FileStream. So why is type inferecing working in this case with c# and not vb.net?</p>
  
  <p>Also, note that "Option Infer" is ON</p>