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

Allow static compliation when propertyMissing in extension

    XMLWordPrintableJSON

Details

    Description

      Arbitrary property names on Maps are treated as .get(propName) and work with @CompileStatic.

      If a class itself or a registered extension provides propertyMissing implementations at compile time, those should be called in the compiler output. The return value of such implementations should be used to infer the type of the result of the property access. So with propertyMissing any class should be elevated to the same treatment as Map when it comes to @CompileStatic.

      propertyMissing should behave the same as getAt/putAt operator overloading, again just like it does for Map.

      So with

      def propertyMissing(String propName)

      { getAt(propName) }

      both obj.ANYPROP and obj["ANYPROP"] should allow static compilation.

      Attachments

        Activity

          People

            Unassigned Unassigned
            eddelplus Jochen Eddelbuettel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: