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

A trait that defines a static method that uses generic return types throws "BUG! Type is null"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.6
    • Fix Version/s: 2.4.7
    • Component/s: None
    • Labels:
      None

      Description

      If you have a trait that defines a method such as:

          static <T> T withClient(MyTrait myTrait, @DelegatesTo(MyTrait) Closure<T> callable ) {
              // no-op
          }
      

      Compilation will fail with:

      BUG! Type is null. Most probably you let a transform reuse existing ClassNodes with generics information, that is now used in a wrong context.
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                graemerocher1 Graeme Rocher
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: