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

Cannot pass generic list into explicit setter

    XMLWordPrintableJSON

    Details

      Description

      class GC {
          void setStrings(List<String> ss) {}
      }
      
      @groovy.transform.CompileStatic
      void usage(GC gc) {
          gc.strings = Collections.emptyList()
      }
      
      [Static type checking] - Cannot assign value of type java.util.List <T extends java.lang.Object> to variable of type java.util.List <String>
       at line: 7, column: 5
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emilles Eric Milles
                Reporter:
                daniilo Daniil Ovchinnikov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m