title: Why is TryParse in C#7 syntax (empty out parameter) emitting a warning if you compile it?
body: <p>In C#7, you are allowed to do</p>
  <pre><code>            if (int.TryParse(&quot;123&quot;, out int result)) 
                  Console.WriteLine($&quot;Parsed: {result}&quot;);
  </code></pre>
  <p>or - if you don't use the result and just want to check if the parsing succeeds, <a href="https://docs.microsoft.com/en-us/dotnet/csharp/discards" rel="nofollow noreferrer">discard</a> the out value:</p>
  <pre><code>           if (int.TryParse(&quot;123&quot;, out _))
                  Console.WriteLine(&quot;Syntax OK&quot;);                
  </code></pre>
  <p>That works fine usually, but in Visual Studio 2017 the second example, where the <strong><code>out</code> parameter is empty,</strong> generates the warning</p>
  <blockquote>
  <p>Warning AD0001: Analyzer 'Microsoft.CodeAnalysis.CSharp.Diagnostics.SimplifyTypeNames.CSharpSimplifyTypeNamesDiagnosticAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.</p>
  </blockquote>
  <p>The Visual Studio Versions where I could verify that it occurs is</p>
  <blockquote>
  <p>Visual Studio Enterprise 2017 Version 15.1 (26403.7) Release <br/>
  Visual Studio Enterprise 2017 Version 15.2 (26430.4) Release</p>
  </blockquote>
  <p>Is this a bug, or is the usage of <code>int.TryParse(&quot;123&quot;, out _)</code> not officially supported? I could not find any hint so far.</p>
  <hr />
  <p>For completeness, here's the code of the console application showing the issue:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApp1
  {
      class Program
      {
          static void Main(string[] args)
          {
              if (int.TryParse(&quot;123&quot;, out _))
                  Console.WriteLine(&quot;Syntax OK&quot;);
          }
      }
  }
  </code></pre>