Daniil Ovchinnikov created GROOVY-8909:
------------------------------------------

             Summary: List literal type inference does not take its context 
into account
                 Key: GROOVY-8909
                 URL: https://issues.apache.org/jira/browse/GROOVY-8909
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
    Affects Versions: 2.5.4
            Reporter: Daniil Ovchinnikov


{code:title=bug.groovy}
def methodAcceptingListOfObjects(List<Object> lo) {}

@groovy.transform.CompileStatic
def usage() {
    methodAcceptingListOfObjects([1, 2, 3]) 
}
{code}
Compilation fails with
{noformat}
[Static type checking] - Cannot call 
#methodAcceptingListOfObjects(java.util.List <java.lang.Object>) with arguments 
[java.util.List <java.lang.Integer>]
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to