eric-milles commented on PR #1767:
URL: https://github.com/apache/groovy/pull/1767#issuecomment-2528805577

   For circumstances that go through `ScriptBytecodeAdapter`, the sender class 
is not propagated to `MetaClassImpl`.  Access checks give different results, 
since the sender is re-mapped to the object.
   
   * 
https://github.com/apache/groovy/blob/981928053477e7d7790e0b6000e7a4dd5b45b583/src/main/java/org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java#L472
   * 
https://github.com/apache/groovy/blob/981928053477e7d7790e0b6000e7a4dd5b45b583/src/main/java/org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java#L504
   
   ```groovy
               package p
               class A {}
               class B {}
               class C {
                   boolean setter
                   protected A foo = new A()
                   A getFooA() { return this.@foo }
                   void setFoo(A a) { setter = true; this.@foo = a }
               }
               class D extends C {
                   protected B foo = new B() // hides A#foo; should hide 
A#setFoo in subclasses
                   B getFooB() { return this.@foo }
               }
   ```
   
   ```groovy
   import p.*
               class E extends D {}
               def e = new E()
               e.foo = null // not the field from this perspective
               assert e.setter // fails
   ```


-- 
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: notifications-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to