Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
1.6-beta-1, 1.5.7, 1.6-beta-2
-
None
-
None
-
sun java 1.6.0_u10, Linux (2.6.24)
Description
This code works under 1.5.6 but not with newer versions.
Test-Code:
class Test { static void main( args ) { Task t = new Task() List l = t.myCall() println l.dump() } } interface MyCallable<T> { T myCall() throws Exception; } class Task implements MyCallable<List> { List myCall() throws Exception { return [ 42 ] } }
results in:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, /home/lukas/temp/groovytest2.groovy: 14: the return type is incompatible with java.lang.Object myCall() in MyCallable. Node: org.codehaus.groovy.ast.MethodNode. At [14:5] @ line 14, column 5. List myCall() throws Exception { ^