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/02/03 22:33:00 UTC

[jira] [Closed] (GROOVY-10295) STC: cannot infer list or map type for method return

     [ https://issues.apache.org/jira/browse/GROOVY-10295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-10295.
------------------------------

> STC: cannot infer list or map type for method return
> ----------------------------------------------------
>
>                 Key: GROOVY-10295
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10295
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static Type Checker
>    Affects Versions: 2.5.15, 4.0.0-beta-1, 3.0.9
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-2
>
>
> Follow up from GROOVY-6408, GROOVY-7106, GROOVY-7274, GROOVY-7468, GROOVY-8909, GROOVY-8961, GROOVY-9734, GROOVY-9844, GROOVY-9915
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> Map<String, Object> m(Date date, String query, String source)
> {
>   return [date: date, query: query, source: source]
> }
> {code}
> STC emits error "Incompatible generic argument types. Cannot assign java.util.LinkedHashMap<java.lang.String, java.io.Serializable<? extends java.io.Serializable<java.util.Date>>> to: java.util.Map<java.lang.String, java.lang.Object>".  It should be subject to same result type inference of assignment.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)