Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.2
-
None
-
Groovy Version: 1.7.2 JVM: 1.6.0_12
Running in Debian lenny amd64 with linux kernel 2.6.32
Description
Cannot compile statements like SomeClass.<Integer>create(). Example code:
Test.groovy
class Test<E> { E someVariable; protected Test() { } public static <E> Test<E> create() { return new Test<E>(); } public static void main(String[] args) { Test<Integer> t = Test.<Integer>create(); } }
The error is:
$ groovy Test.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: /home/aless/Test.groovy: 12: Unknown type: TYPE_ARGUMENTS at line: 12 column: 26. File: /home/aless/Test.groovy @ line 12, column 26. Test<Integer> t = Test.<Integer>create(); ^ 1 error
Exactly the same file (with a .java extension) compiles with javac.