On 15.08.24 13:46, OCsite wrote:
[...]
test(true) "oops" // a string is not?!?
this is essentially https://groovy-lang.org/dsls.html#_command_chains
and means
test(true).oops.
What would work is
test true "oops"
[...]
Caught: java.lang.NullPointerException: Cannot get property 'oops'
Not a parser issue, as only closures can be used as the last argument outside
of the parentheses of a method invoked with explicit parentheses. (The closure
is not recognized as the 2nd arg, but the last arg)
The Apache Groovy programming language - Style guide (groovy-lang.org)
You could also
A closure as the second argument is the only case where arguments
don't need to be comma separated. These both work:
test true, "oops"
test (true), "oops"
Cheers, Paul.
On Thu, Aug 15, 2024 at 9:47 PM OCsite wrote:
>
> Hi there,
>
> is this my fault, for I missed some documentation somewhere, o
Hi there,
is this my fault, for I missed some documentation somewhere, or a parser fault,
for it should have recognised the bool as the 1st and string as the 2nd
argument and just call “test” with “true, 'oops'” in the last case (as I've,
perhaps mistakenly, assumed)?
===
782 ocs /tmp>
prin