Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6362

Support for dynamic method calls in static compilation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0
    • Static compilation
    • 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.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: