title: CS0103 and CS0136 with pattern matching
body: <p>I'm a little bit confused. Why from one side I become <code>CS0103</code>(variable does not exist) and from another side <code>CS0136</code>(with own words - variable already exists) and declaration of variables with same names in switch works?</p>
  
  <p>This <strong>works</strong>:  </p>
  
  <pre><code>var obj = new object();
  switch (obj)
  {
      case string str:
          break;
  
      case object str:
          break;
  }
  </code></pre>
  
  <p>Here I become compilation error <strong>CS0103</strong> "The name ' ' does not exist in the current context":  </p>
  
  <pre><code>var obj = new object();
  switch (obj)
  {
      case string str: 
          break;
  }
  if (str == null) { } //CS0103
  </code></pre>
  
  <p>Here I become compilation error <strong>CS0136</strong>:  </p>
  
  <pre><code>var obj = new object();
  switch (obj)
  {
      case string str: //&lt;--- CS0136
          break;
  }
  string str = "";
  </code></pre>
  
  <p><a href="https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0136" rel="nofollow noreferrer">CS0136: A local variable named 'var' cannot be declared in this scope because it would give a different meaning to 'var', which is already used in a 'parent or current/child' scope to denote something else</a>  </p>
  
  <p><a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0103" rel="nofollow noreferrer">CS0103: The name 'identifier' does not exist in the current context</a>  </p>