jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-3611

CLONE -Compile-error when implementing a method from a generic interface

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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)

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 {
       ^

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Dan Hinojosa added a comment - 05/Jul/09 2:30 AM

This came back as of 1.6.3

Show
Dan Hinojosa added a comment - 05/Jul/09 2:30 AM This came back as of 1.6.3
Hide
Permalink
Roshan Dawrani added a comment - 05/Jul/09 6:34 AM

I am unable to reproduce the issue on both 1.6.4 and 1.7-beta-1 dev branches.

GROOVY-3129 (whose clone the current JIRA) is, was fixed much before 1.5.8/1.6.1 release and the exact test case
provided in that has been part of groovy test suite since then and it is still going through.

So, can you double check your environment and verify the version of groovy being used,etc?

Show
Roshan Dawrani added a comment - 05/Jul/09 6:34 AM I am unable to reproduce the issue on both 1.6.4 and 1.7-beta-1 dev branches. GROOVY-3129 (whose clone the current JIRA) is, was fixed much before 1.5.8/1.6.1 release and the exact test case provided in that has been part of groovy test suite since then and it is still going through. So, can you double check your environment and verify the version of groovy being used,etc?
Hide
Permalink
Roshan Dawrani added a comment - 06/Jul/09 12:56 PM

Hi,
Could you confirm the groovy version you are using when you get this error? Otherwise, I am planning to mark it as "Cannot reproduce" as on both 1.6.x an d 1.7.x, what you have reported is working.

Thanks,
Roshan

Show
Roshan Dawrani added a comment - 06/Jul/09 12:56 PM Hi, Could you confirm the groovy version you are using when you get this error? Otherwise, I am planning to mark it as "Cannot reproduce" as on both 1.6.x an d 1.7.x, what you have reported is working. Thanks, Roshan
Hide
Permalink
Roshan Dawrani added a comment - 07/Jul/09 11:00 AM

I have verified on 1.6.0, 1.6.4 and 1.7.-beta-1 (with JDK 1.5) and I don't see the anywhere. This test case is also present in groovy's test suite and runs on configurations that cover JDK 1.4, 1.5, 1.6 and it's not failing anywhere there also.

Still, if you confirm after checking out your environment that you are seeing the issue, please re-open this one. For now, there is nothing to be done unless you come back otherwise.

Show
Roshan Dawrani added a comment - 07/Jul/09 11:00 AM I have verified on 1.6.0, 1.6.4 and 1.7.-beta-1 (with JDK 1.5) and I don't see the anywhere. This test case is also present in groovy's test suite and runs on configurations that cover JDK 1.4, 1.5, 1.6 and it's not failing anywhere there also. Still, if you confirm after checking out your environment that you are seeing the issue, please re-open this one. For now, there is nothing to be done unless you come back otherwise.
Hide
Permalink
Dan Hinojosa added a comment - 07/Jul/09 11:28 AM

No problem. I still have this error here on 1.6.3. It is a java superclass and a groovy subclass where I have this issue. I just haven't had time to reconstruct a simple case.

Show
Dan Hinojosa added a comment - 07/Jul/09 11:28 AM No problem. I still have this error here on 1.6.3. It is a java superclass and a groovy subclass where I have this issue. I just haven't had time to reconstruct a simple case.
Hide
Permalink
Dan Hinojosa added a comment - 07/Jul/09 11:40 AM

Made a small example and it works. Hmmm. The project I have is Jboss Seam application, and I am extending a generic java class in groovy. Maybe the joint compiler has something to do with it. Will verify.

Show
Dan Hinojosa added a comment - 07/Jul/09 11:40 AM Made a small example and it works. Hmmm. The project I have is Jboss Seam application, and I am extending a generic java class in groovy. Maybe the joint compiler has something to do with it. Will verify.
Hide
Permalink
Roshan Dawrani added a comment - 07/Jul/09 12:31 PM

If you are able to reproduce your error with a groovy class extending a java class and getting this error, then it will
be good if you can report it as a separate JIRA as then this JIRA won't exactly be a clone of GROOVY-3129

There may be some different issue I groovy compiler where it does generics checks for base classes.
GROOVY-3129 involved generics checks involving interfaces. Not to bother you too much with internals, but if use case is
different, then a separate JIRA please. Thanks.

Show
Roshan Dawrani added a comment - 07/Jul/09 12:31 PM If you are able to reproduce your error with a groovy class extending a java class and getting this error, then it will be good if you can report it as a separate JIRA as then this JIRA won't exactly be a clone of GROOVY-3129 There may be some different issue I groovy compiler where it does generics checks for base classes. GROOVY-3129 involved generics checks involving interfaces. Not to bother you too much with internals, but if use case is different, then a separate JIRA please. Thanks.

People

  • Assignee:
    Roshan Dawrani
    Reporter:
    Dan Hinojosa
Vote (0)
Watch (0)

Dates

  • Created:
    05/Jul/09 2:28 AM
    Updated:
    15/Oct/09 5:16 PM
    Resolved:
    07/Jul/09 11:00 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.