title: Cannot assign void to an implicitly-typed local variable with var and foreach
body: <p>I'm trying to list all buttons name from my form to list with code </p>
  
  <pre><code>var v = new List&lt;Form1&gt;() { this }.ForEach(x =&gt; { x.GetType().Name.Contains(typeof(Button).Name); });
  </code></pre>
  
  <p>and always get error </p>
  
  <blockquote>
    <p>Cannot assign void to an implicitly-typed local variable</p>
  </blockquote>
  
  <p>How to bypass that?</p>