You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/04/27 08:34:00 UTC
[jira] [Closed] (GROOVY-10576) STC: map putAll fails to match "?" to "Object"
[ https://issues.apache.org/jira/browse/GROOVY-10576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-10576.
------------------------------
> STC: map putAll fails to match "?" to "Object"
> ----------------------------------------------
>
> Key: GROOVY-10576
> URL: https://issues.apache.org/jira/browse/GROOVY-10576
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1, 2.5.17, 3.0.11, 4.0.2
>
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> class C {
> Map<String,Object> map
> void test(Map<? extends String, ?> m) {
> map.putAll(m)
> }
> }
> {code}
> {{javac}} allows {{putAll}} in this situation. {{groovyc}} emits an error: Cannot call {{java.util.Map#putAll(java.util.Map<? extends java.lang.String, ? extends java.lang.Object>)}} with arguments {{[java.util.Map<? extends java.lang.String, ?>]}}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)