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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@apache.org
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)