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

Generic is not inferred from context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.0.5, 2.5.13
    • None
    • Static Type Checker
    • None

    Description

      bugs.groovy
      static void stuff(List<String> operations) {}
      
      @groovy.transform.CompileStatic
      void usage() {
          stuff(Collections.emptyList()) // 
      }
      
      usage()
      

      Results in compilation error:

      [Static type checking] - Cannot call bugs#stuff(java.util.List <java.lang.String>) with arguments [java.util.List <T extends java.lang.Object>] 
       @ line 5, column 5.
             stuff(Collections.emptyList())
             ^
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              daniilo Daniil Ovchinnikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: