Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Information Provided
-
1.6.2
-
None
-
None
-
WindowsXP
Description
I see two related problems with simple static import on classes that suppose to be already be imported in namespace:
1) This failed running from a script:
import static Math.*; println(random())
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, D:\test.groovy: 1: unable to resolve class Math
@ line 1, column 1.
import static Math.*; println(random())
^
1 error
But this in a script will work:
import static java.lang.Math.*; println(random())
2) This failed running from a command line:
groovy -e "import static java.lang.Math.*; println(random())"
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, script_from_command_line: 1: unexpected token: ( @ line 1, column 22.
1 error