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

Cannot DGM.plus() two lists with different types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Java
      void foo(List<String> s, List<Integer> i) {
        DefaultGroovyMethods.plus(s, i);
      }
      

      Expected: Javac should infer return type as List<Serializable>, but it can't.
      Possible fix: define DGM.plus with wildcard types ? extends T

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: