Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.3.7
-
None
-
Any
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.