title: Does VB.NET and Visual Studio 2010 support multiline anonymous method?
body: <p>I found that <a href="https://stackoverflow.com/questions/671631/does-vb-net-have-anonymous-functions">this answer</a> was asked and answered before VS2010 was actually released.</p>
  
  <p>They say that</p>
  
  <blockquote>
    <p>VB9 has only single-line anonymous
    functions. We're adding full statement
    and multi-line lambdas in VB10.</p>
  </blockquote>
  
  <p>But I tried to add this code </p>
  
  <pre><code> Dim test2 = Function(t1 As T, t2 As T) (
   Dim val1 As IComparable = DirectCast(prop.GetValue(t1), IComparable)
   Dim val2 As IComparable = DirectCast(prop.GetValue(t2), IComparable)
   Return val1.CompareTo(val2)
   )
  </code></pre>
  
  <p>to a .NET Framework 4.0 project in Visual Studio 2010 and it does not compile.</p>
  
  <p>Do you now if this feature is really implemented and what I am doing wrong?</p>