[
https://issues.apache.org/jira/browse/GROOVY-9784?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-9784.
-----------------------------
> GroovyRowResult not assignable to Map<String, Object> with static type checker
> ------------------------------------------------------------------------------
>
> Key: GROOVY-9784
> URL: https://issues.apache.org/jira/browse/GROOVY-9784
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.5.13
> Reporter: Mauro Molinari
> Priority: Minor
> Fix For: 4.0.0-alpha-1, 3.0.10
>
>
> I don't know when it started to happen, but it worked somewhere in the past.
> This code does not compile with 2.5.13:
>
> {code:groovy}
> package test
> import groovy.sql.Sql
> import groovy.transform.CompileStatic
> @CompileStatic
> public class Test {
> void foo() {
> Map<String, Object> r = new Sql((Sql) null).firstRow("")
> }
> }
> {code}
> The error given is:
> {noformat}
> Groovy:[Static type checking] - Incompatible generic argument types. Cannot
> assign groovy.sql.GroovyRowResult to: java.util.Map <String, Object>
> {noformat}
> This is probably due to the fact that {{GroovyRowResult}} implements {{Map}}
> as a raw type, but IMHO {{Map<String, Object>}} should be the right generic
> interface for it, so perhaps an improvement can be made?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)