~/groovy
% tree
.
├── lib
│ ├── GTemplate.class
│ └── GTemplate.groovy
└── Simple.groovy
class GTemplate {
static def toHtml() {
this.newInstance().toHtml1()
}
def toHtml1() {
"test"
}
}
import lib.*
class Simple extends GTemplate {
}
Error:
% groovyc Simple.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Compilation incomplete: expected to find the class lib.GTemplate in /home/bhaarat/groovy/lib/GTemplate.groovy, but the file contains the classes: GTemplate 1 error