You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Aarjav Patel <aa...@semandex.net> on 2017/04/05 15:26:45 UTC

Literal negative values as keys of a map

Hi,

Right now when initializing a map, we have to use parenthesis sometimes:
Map<Integer, ?> foo = [1: 'ok', (-1): 'not ok']
If it's not too hard, I'd like to be able to define it as:
Map<Integer, ?> foo = [1: 'ok', -1: 'all is well :)']

Although there might be a steep learning curve for me, let me know if
there's anything I might be able to help with.

Thanks,

- Aarjav