Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.8.0
-
None
-
None
-
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
Groovy Version: 1.8.0 JVM: 1.6.0_24
Darwin 21.99.240.10.in-addr.arpa 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) Groovy Version: 1.8.0 JVM: 1.6.0_24 Darwin 21.99.240.10.in-addr.arpa 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
Description
The following code fails with a compilation exception due to "bad syntax"
Foo.java
public interface Foo {}
Bar.groovy
class Bar {
<Foo> void foo() {}
}
groovyc Foo.java Bar.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Bar.groovy: 2: unexpected token: < @ line 2, column 5. <Foo> void foo() {} ^ 1 error
However if the public modifier is added to the method declaration this will work. BUT it breaks when @Delegate is added into the mix (I know AST xforms have plenty of corner cases, I'm pretty confident that if the 1st error is solved then @Delegate should work as well).
Attachments
Attachments
Issue Links
- duplicates
-
GROOVY-4757 Can't compile method with generic signatures and default visibiliy access
- Closed