groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <>
Subject Re: Omitting parentheses on .size() ?
Date Wed, 05 Aug 2020 07:34:09 GMT
On 04.08.20 16:13, MG wrote:
> On 04/08/2020 15:16, Basurita wrote:
>> On 8/1/20 14:41, MG wrote:
>>> Hmmm, I am for consistency, but at least I use very few maps as
>>> compared to lists, and rarely ever output the size of a map, but
>>> constantly for
>>> lists, so having getSize() on List would still be beneficial.
>> You're free to add whatever you want to your metaClass :-)
> In dynamic Groovy, yes, but I am an IntelliJ / @CompileStatic Groovy
> user so afaiaao there is no way to make this work in my case...

for @CompileStatic this can be done via extension methods.

Afaik it is still the case, that the classes containing extension
methods must be compiled before their use in a separate compilation so
the compiler can pick them up as part of the compilation once you want
to use them.

bye Jochen

View raw message