[
https://issues.apache.org/jira/browse/GROOVY-7103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles closed GROOVY-7103.
-------------------------------
> Allow static compliation when propertyMissing in extension
> ----------------------------------------------------------
>
> Key: GROOVY-7103
> URL: https://issues.apache.org/jira/browse/GROOVY-7103
> Project: Groovy
> Issue Type: Improvement
> Components: Static Type Checker
> Reporter: Jochen Eddelbuettel
> Priority: Minor
> Labels: @CompileStatic, metaprogramming
>
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)