[
https://issues.apache.org/jira/browse/GROOVY-11028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11028:
---------------------------------
Description:
Consider the following:
{code:groovy}
@groovy.transform.TypeChecked
void test() {
// Cannot assign Map<Object, ? extends Object> to Map<String, Number>
Map<String,Number> map = [:].withDefault { 0 }
}
{code}
was:
Consider the following:
{code:groovy}
@groovy.transform.TypeChecked
Map<String,Number> test() {
[:].withDefault { 0 } // Cannot assign Map<Object, ? extends Object> to
Map<String, Number>
}
{code}
> STC: empty map or list literal does not type check like Collections.emptyMap()
> ------------------------------------------------------------------------------
>
> Key: GROOVY-11028
> URL: https://issues.apache.org/jira/browse/GROOVY-11028
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 4.0.4
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test() {
> // Cannot assign Map<Object, ? extends Object> to Map<String, Number>
> Map<String,Number> map = [:].withDefault { 0 }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)