title: Why can't I instantiate a Groovy class from another Groovy class?
body: <p>I have two classes.  One.groovy:</p>
  
  <pre><code>class One {
  
    One() {}
  
    def someMethod(String hey) {
      println(hey)
    }
  }
  </code></pre>
  
  <p>And Two.groovy:</p>
  
  <pre><code>class Two {
  
    def one
  
    Two() {
      Class groovy = ((GroovyClassLoader) this.class.classLoader).parseClass("One.groovy")
      one = groovy.newInstance()
      one.someMethod("Yo!")
    }
  }
  </code></pre>
  
  <p>I instantiate Two with something like this:</p>
  
  <pre><code>GroovyClassLoader gcl = new GroovyClassLoader();
  Class cl = gcl.parseClass(new File("Two.groovy"));
  Object instance = cl.newInstance();
  </code></pre>
  
  <p>But now I get <code>groovy.lang.MissingMethodException: No signature of method: script13561062248721121730020.someMethod() is applicable for argument types: (java.lang.String) values: [Yo!]</code></p>
  
  <p>Any ideas?</p>