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

Generated Java stub for inner interface with generics fails to compile

    XMLWordPrintableJSON

Details

    Description

      I have a Groovy class with a method signature like:

          static<T> Promise<List<T>> createPromise(List<Closure<T>> closures, List<Promise.Decorator> decorators) {
              promiseFactory.createPromise(closures, decorators)
          }
      

      The java stub that is generated looks like

      public static <T> grails.async.Promise<T> createPromise(groovy.lang.Closure<T> c, java.util.List<grails.async.Promise<T>.Decorator> decorators) { return (grails.async.Promise<T>)null;}
      

      This fails to compile with:

      [ant:groovyc] /var/folders/hl/pxmk_v3x
      [ant:groovyc] 48l314rrxckj16sw0000gn/T/groovy-generated-6992284223603375969-java-source/grails/async/Promises.java:27: cannot select a static 
      [ant:groovyc] class from a parameterized type
      [ant:groovyc] public static <T> grails.async.Promise<java.util.List<T>> createPromise(java.util.List<groovy.la
      [ant:groovyc] ng.Closure<T>> closures, java.util.List<grails.async.Promise<T>.Decorator> decorators) { return (grails.async.Promise<java.util.
      [ant:groovyc] List<T>>)null;}
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: