You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Mauro Molinari (Jira)" <ji...@apache.org> on 2020/10/20 09:35:00 UTC
[jira] [Created] (GROOVY-9784) GroovyRowResult not assignable to
Map with static type checker
Mauro Molinari created GROOVY-9784:
--------------------------------------
Summary: 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
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.3.4#803005)