The following fails to compile with Groovy 4.0.5:
At first glance, this seems similar to
GROOVY-10613 and some of its related issues.
We can workaround by casting the above to Map<String, Integer>, but this was not necessary in Groovy 3.x.
Thanks to otogami for creating the reproducer