codeconsole commented on PR #3121:
URL: https://github.com/apache/groovy/pull/3121#issuecomment-6717050125

   @daniellansun Merging current master into this PR made 
`VirtualAnnotationTest.virtualStaticAccessor_namedLikeClassProperty_writtenAsProperty`
 fail under `@CompileStatic`: `Over.sc()` returned `'OverbOverb'`.
   
   The cause is GROOVY-12613 (9d8259b8e3). Since that change, trait code keeps 
`name += 'b'` as a compound assignment instead of rewriting it to `name = name 
+ 'b'`. The type checker checks the read of `x op= y` on a copy of `x`, and 
this PR's `onMethodSelection` marks that copy dynamic. The code generator, 
though, reads through `x` itself, which was still bound to `Class.getName()`.
   
   3f0f494f76 carries the copy's dynamic resolution over to `x`, but only when 
no setter was selected for the write. It sits next to the GROOVY-12524 handling 
of extension getters. With master merged in (90fdac76bb), `traitx.*`, 
`groovy.transform.stc.*`, `org.codehaus.groovy.classgen.asm.sc.*`, 
`Groovy12524` and `Groovy12619` pass (5,247 tests).
   


-- 
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