Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
It might be interesting to instruct the compiler that some method calls in Groovy are to be made dynamically even if in a @CompileStatic section.
For example, if we want to enable @CompileStatic on Grails controllers and still want to be able to call dynamic finders, method calls starting with "find" should be recognized as dynamic calls.
The idea is to write a type checking extension for this, to instruct the compiler:
- which methods are meant to be called dynamically
- what is the expected (inferred) return type of such a call
The latter is very important in order to keep the "grooviness" of code, otherwise you would need to add explicit casts for each dynamic method call.