I am trying to understand the behaviour in the following code examples
groovy:000> [][0] ===> null groovy:000> [][0..0] ERROR java.lang.IndexOutOfBoundsException: toIndex = 1 at groovysh_evaluate.run (groovysh_evaluate:2) ... groovy:000> Why does the first code segment return null, whereas the second throw an IndexOutofBoundsException. My expectation was for this to be consistent with the outcome of the first code fragment.
I am using the groovy compiler 2.1.4
Thanks.