title: C# Compiler should give warning but doesn't?
body: <p>Someone on my team tried fixing a 'variable not used' warning in an empty catch clause.</p>
  
  <pre><code>try { ... } catch (Exception ex) { }
  </code></pre>
  
  <p>-> gives a warning about <code>ex</code> not being used. So far, so good.</p>
  
  <p>The fix was something like this:</p>
  
  <pre><code>try { ... } catch (Exception ex) { string s = ex.Message; }
  </code></pre>
  
  <p>Seeing this, I thought "Just great, so now the compiler will complain about <strong><code>s</code></strong> not being used."</p>
  
  <p>But it doesn't! There are no warnings on that piece of code and I can't figure out why. Any ideas?</p>
  
  <p>PS. I know catch-all clauses that mute exceptions are a bad thing, but that's a different topic. I also know the initial warning is better removed by doing something like this, that's not the point either.</p>
  
  <pre><code>try { ... } catch (Exception) { }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>try { ... } catch { }
  </code></pre>