Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.6-beta-1, 1.5.7, 1.6-beta-2
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.6.4, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Environment:sun java 1.6.0_u10, Linux (2.6.24)
-
Number of attachments :
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 { ^