John created GROOVY-8345:
----------------------------
Summary: Exception in phase 'semantic analysis'
Key: GROOVY-8345
URL: https://issues.apache.org/jira/browse/GROOVY-8345
Project: Groovy
Issue Type: Bug
Affects Versions: 2.4.12
Environment: Java8, Windows
Reporter: John
Attachments: setup.zip
Hi,
I get this error when I run ant target below:
{code}
BUG! exception in phase 'semantic analysis' in source unit '....\test.groovy'
The lookup for two.bar caused a failed compilaton. There should not have
been any compilation from this call.
at
org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:190)
....
{code}
I don't get the error if I run the script via cmdline:
{{groovy-2.4.12/bin/groovy -cp . test.groovy}}
h4. Setup:
{code}build.xml
test.groovy
one/foo.groovy
two/bar.groovy
groovy-all-2.4.12-indy.jar{code}
{{build.xml:}}{code}
<project>
<taskdef resource="org/codehaus/groovy/antlib.xml">
<classpath>
<pathelement location="groovy-all-2.4.12-indy.jar"/>
</classpath>
</taskdef>
<target name="test">
<groovy src="test.groovy"/>
</target>
</project>{code}
{{test.groovy:}}{code}
import one.foo
import two.bar
bar.run()
{code}
{{one/foo.groovy:}}{code}
package one
class foo {
}
class foobar {
foobar() {
println("foobar")
}
}{code}
{{two/bar.groovy:}}{code}
package two
import one.foobar
class bar {
static def run() {
new foobar()
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)