Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2320

the abstract method test seems not to know covariant returns types yet

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-rc-2
    • 1.1-rc-3
    • class generator
    • None
    • JDK6u3, WinXP

    Description

      from mailing list:

      Hi all,

      Executing the following code, Groovy will complain:
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script2: 3: Can't have an abstract method in a non-abstract class. The class 'CallableTask' must be declared abstract or the method 'java.lang.Object call()' must be implemented.
      @ line 3, column 1.
      1 error

      <groovy>
      import java.util.concurrent.*

      class CallableTask implements Callable<String> {
      public String call()

      { return new Date().toString() }


      }
      </groovy>

      but in Java, the code can be compiled with no problem.

      Could you some one tell me why?

      Thanks in advance,
      Daniel.Sun

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            daniel_sun Daniel Sun
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: