You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Gianluca Sartori <g....@gmail.com> on 2026/10/08 08:09:00 UTC

Maps

Hi people,

I was wondering why I have to do a cast to make it compile (Groovy 5 and
@CompileStatic):

private Map getFetch() {
    return [user: 'join']
}

private Map getFetchAll() {
    return fetch + ([:] as Map)
}



Gianluca Sartori
--
https://dueuno.com

Re: Maps

Posted by Gianluca Sartori <g....@gmail.com>.
ERRATA CORRIGE

It compiles, IntelliJ underlines it in red, I guess it's something with the
intelliJ Groovy plugin


Gianluca Sartori
--
https://dueuno.com


On Thu, 8 Oct 2026 at 10:09, Gianluca Sartori <g....@gmail.com> wrote:

>
> Hi people,
>
> I was wondering why I have to do a cast to make it compile (Groovy 5 and
> @CompileStatic):
>
> private Map getFetch() {
>     return [user: 'join']
> }
>
> private Map getFetchAll() {
>     return fetch + ([:] as Map)
> }
>
>
>
> Gianluca Sartori
> --
> https://dueuno.com
>