You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2017/09/05 15:34:00 UTC

[jira] [Created] (GROOVY-8309) Cannot DGM.plus() two lists with different types

Daniil Ovchinnikov created GROOVY-8309:
------------------------------------------

             Summary: Cannot DGM.plus() two lists with different types
                 Key: GROOVY-8309
                 URL: https://issues.apache.org/jira/browse/GROOVY-8309
             Project: Groovy
          Issue Type: Bug
            Reporter: Daniil Ovchinnikov


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

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



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)