groovy icon indicating copy to clipboard operation
groovy copied to clipboard

GROOVY-8283: field hides getter of super class (not interface)

Open eric-milles opened this issue 3 years ago • 3 comments

For the dynamic side of 8283, field can be selected in MetaClassImpl. If access method is declared by an interface, the interface method is the one indexed so must be considered pervasive in the type hierarchy (cannot be safely hidden). Not sure if this kind of name hiding should be extended to inner classes; hopefully the commit is enough of a first step to determine if this protocol should be changed or left alone.

@blackdrag @paulk-asert

TODO:

  • STC selection of field vs setter (verify what StaticTypeCheckingVisitor does vs MetaClassImpl)
  • static compiler classgen -- I think it currently selects the method

https://issues.apache.org/jira/browse/GROOVY-8283

eric-milles avatar Aug 19 '22 17:08 eric-milles

https://github.com/apache/groovy/pull/1767/commits/c8805170944018f17fcc5f68b760c423d43f23ce might be good to go in on its own. There is some confusion between sender and theClass because MetaClassImpl uses theClass for sender in the get and set variants that accept only receiver and name.

eric-milles avatar Apr 28 '24 02:04 eric-milles