Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.5
-
None
-
None
Description
Given the following code:
class Website { Long id String url Load load static constraints = { Website.load 1 load nullable:true url url:true } static Website load(Long id) { Website.get(id) } } class Load { Long id Integer connections }
The call to:
load nullable:true
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:
Website.load 1
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.
Attachments
Issue Links
- is related to
-
GROOVY-6883 Closure in child class cannot access static method in parent class
- Closed