Given the following code:
The call to:
Will not go through the closure and instead dispatch directly as a static method call. This means it is impossible to control DSL definition. At the AST level the above call seems to be a StaticMethodCallExpression. This is strange because:
Is a normal method call expression. Method calls defined in static closures should never be StaticMethodCallExpression instances otherwise a DSL author cannot control the method dispatch.