Resolution: Not A Problem
Affects Version/s: 1.8.8
Fix Version/s: None
Component/s: ast builder
Not sure that this is really a bug (maybe there are some good reasons to have this behaviour).
But it seems that, after building the AST of some groovy piece of code, it can happen that the returned AST contains node being a PropertyExpression while I would expect it to be a MethodCallExpression.
For example, as in Groovy we can omit parenthesis when performing a method call.
Those 2 piece of codes have the same result:
but they should also generate exactly the same AST, should not they ?
Here is the TestCase showing that it's not the case as it prints is:
or to copy-paste in the Groovy Web Console:
This discrepancy could have some impacts for AST "parsers" which have some rules (for security or whatever) depending on PropertyExpression, MethodCallExpression, etc ...