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

CompileStatic cannot infer generic return type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.1
    • 2.4.3
    • Static Type Checker
    • None

    Description

      public <T> T getSomething() { null }
      
      @groovy.transform.CompileStatic
      public List getList() { getSomething() }
      

      Error:

      [Static type checking] - Cannot return value of type T on method returning type java.util.List
      

      Attachments

        Issue Links

          Activity

            People

              melix C├ędric Champeau
              gillius Jason Winnebeck
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: