title: Why is Groovy not catching my instanceof?
body: <p>In the following code:</p>
  
  <pre><code>static void main(String[] args) {
      String str
  
      if(str instanceof String) {
          println "'str' is a String!"
      } else {
          println "I have absolutely no idea what 'str' is."
      }
  }
  </code></pre>
  
  <p>The statement "<em>I have absolutely no idea what 'str' is.</em>" is what prints. <strong>Why, and what can I do to make Groovy see that <code>str</code> is a String (besides making the String non-null)?</strong></p>