eric-milles opened a new pull request, #2360:
URL: https://github.com/apache/groovy/pull/2360

   I'm on the fence about this one.  On the off chance an inner class' super 
class provides "methodMissing" or "propertyMissing", all inner class non-static 
dispatch methods need to call `super.methodMissing(name,args)` or 
`super.propertyMissing(name)` or `super.propertyMissing(name,value)`.  The 
super class must throw a MissingMethodException or MissingPropertyException for 
the caller to be able to fall back on current behavior.
   
   ```groovy
   class Outer {
     class Inner {
       // ...
       Object methodMissing(String name, Object args) {
         if (!"methodMissing".equals(name))
         try {
           super.methodMissing(name, args)
         } catch (MissingMethodException ignore) {
         }
         try {
           // outerClass.name(args)
         } catch (MissingMethodException notFound) {
           throw new MissingMethodException(notFound.method, this, 
notFound.arguments)
         }
       }
     }
   }
   ```
   
   The "ignore" exception could be thrown for no super class "methodMissing" or 
no "name" support, which is not ideal.  In the event the super class does not 
supply "methodMissing", there is a call to this method which is why a guard was 
added (to prevent stack overflow).  :(


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to