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

@Delegate - sometimes compilation fails for generic types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-2, 1.8.6
    • 2.0.5
    • Compiler
    • None
    • JVM: 1.6.0_29 Vendor: Apple Inc. OS: Mac OS X

    Description

      we have some classes using @Delegate on generic classes:

      @Commons
      class FilterList {

      @Delegate List<Map<Dimension, List<String>>> filterList = []

      ...
      }

      Sometime compilation fails with compiler errors like

      BUG! exception in phase 'class generation' in source unit '/Users/andre/Development/Projects/Adternity/grf/grails-app/jobs/com/grf/reports/ScheduledReportExecutionJob.groovy' Type is null. Most probably you let a transform reuse existing ClassNodes with generics information, that is now used in a wrong context. (Use --stacktrace to see the full trace)

      I assume this has to do with DelegateASTTransformation#nonGeneric handling of generic types, which is setting the generic type to null, but it's hard to reproduce the error in a determined way.

      Attachments

        1. delegate-bug.zip
          5 kB
          David Smith

        Activity

          People

            blackdrag Jochen Theodorou
            andre.steingress Andre Steingress
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: