Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1-beta-2
-
None
-
red hat linux
Description
Re: problem with static imports Click to flag this post
by Paul King Jul 12, 2007; 05:47pm :: Rate this Message: (use ratings to moderate[?])
Reply | Reply to Author | Show Only this Message
Looks like a bug.
If I follow the steps as you suggest I can replicate the error.
If I add "groovyc com/test1/Runner.groovy" then I can invoke
"groovy com/test1/Runner.groovy" with no problem.
Please raise an issue.
Paul.
Jason Weden wrote:
> Paul, thanks for your reply. That "static" keyword in the class definition
> shouldn't have been in there. Could you tell me what's different between
> your setup and mine? It's still isn't working for me:
>
> [nvw384@ma34jasper sandbox]$ groovy -version
> Groovy Version: 1.1-beta-2 JVM: 1.5.0_11-b03
>
> [nvw384@ma34jasper sandbox]$ less com/test1/Runner.groovy
>
> package com.test1
>
> import static com.test1.test2.Utils.*
>
> printMe('hello world');
>
> [nvw384@ma34jasper sandbox]$ less com/test1/test2/Utils.groovy
> package com.test1.test2
>
> class Utils {
> static printMe (aString)
> }
>
> [nvw384@ma34jasper sandbox]$ groovy com/test1/Runner.groovy
> Caught: groovy.lang.MissingMethodException: No signature of method:
> com.test1.Runner.printMe() is applicable for argument types:
> (java.lang.String) values:
> at com.test1.Runner.run(Runner.groovy:6)
> at com.test1.Runner.main(Runner.groovy)
>
>
>
>