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

Groovy 2.2.2 regression in the typechecker's handling of generics

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3.0
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      The following code compiles under Groovy 2.2.1, but not under 2.2.2

      @groovy.transform.CompileStatic
      public class Test<T> {
          public Test(Class<T> p1) { }
      
          static <X> Test<X> create(Class<X> c) { new Test<X>(c) }
      }
      

      Works in both if we strip the generics at the call site:

      package unlogger.dsl.core
      
      @groovy.transform.TypeChecked
      public class Test<T> {
          public Test(Class<T> p1) { }
      
          static <X> Test<X> create(Class<X> c) { new Test<X>(c as Class) }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              ddimitrov Dimitar Dimitrov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: