Eric Milles created GROOVY-10325:
------------------------------------

             Summary: STC: error for map*.value assignment
                 Key: GROOVY-10325
                 URL: https://issues.apache.org/jira/browse/GROOVY-10325
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
            Reporter: Eric Milles


Consider the following:
{code:groovy}
@groovy.transform.TypeChecked
void test() {
  Map<String,Object> map = [foo:'bar']
  map*.value = 'baz' // Incompatible generic argument types. Cannot assign 
java.util.List<java.lang.String> to: java.util.List<java.lang.Object>
}
{code}

I believe this assignment should work since the RHS string is indeed an Object. 
 Not sure if the LHS type should be {{List<? extends Object>}} or the RHS type 
should be {{List<? super String>}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to