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

Cannot implement method from java interface with varargs and generics

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.7, 2.1.1
    • 2.1.2, 2.0.8
    • Compiler
    • None

    Description

      If Java interface defines a method like

      <T> Promise<java.util.List<T>> createPromise(Promise<T>...promises);
      

      It is impossible to implement this in Groovy due to a compilation error such as

      Groovyc: Can't have an abstract method in a non-abstract class. The class 'org.grails.async.factory.gpars.GparsPromiseFactory' must be declared abstract or the method 'grails.async.Promise createPromise([Lgrails.async.Promise;)' must be implemented.
      

      Attachments

        1. groovy6041.tar.gz
          0.7 kB
          Cédric Champeau

        Activity

          People

            melix Cédric Champeau
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: