@dinko yeah, that's why I choose to do my example with listVariable*.getClass()
From: Dinko Srkoč <firstname.lastname@example.org>
Reply: email@example.com <firstname.lastname@example.org>
Date: March 29, 2016 at 14:04:50
To: email@example.com <firstname.lastname@example.org>
Subject: Re: Check if List is of specific size and elements of specific type
On 29 March 2016 at 12:29, Marcos Carceles <email@example.com> wrote:
> Would this work?
> listVariable*.class == [Integer, Integer]
It would in this particular example, but this may be dangerous for
some other cases. Try e.g. this:
[1, [:], [class: 1]]*.class
> On 29 March 2016 at 12:25, Maarten Boekhold <firstname.lastname@example.org> wrote:
>> Is there a quick and easy way to do something like:
>> assert listVariable == [int, int]
>> eg, the list is of size 2 and each element is an int?