groovy
  1. groovy
  2. GROOVY-5386

@Delegate - sometimes compilation fails for generic types

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-2, 1.8.6
    • Fix Version/s: 2.0.5
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      JVM: 1.6.0_29 Vendor: Apple Inc. OS: Mac OS X
    • Number of attachments :
      1

      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.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Andre Steingress
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: