You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2026/02/04 15:33:00 UTC
[jira] [Updated] (GROOVY-7103) Allow static compliation when propertyMissing in extension
[ https://issues.apache.org/jira/browse/GROOVY-7103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-7103:
--------------------------------
Language: groovy
Affects Version/s: (was: 2.3.7)
> 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
> Environment: Any
> 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)