paulk-asert commented on PR #3297:
URL: https://github.com/apache/groovy/pull/3297#issuecomment-6871707474

   Thanks Daniel, all of these checked out. I've pushed 3ef9259bb1 in response.
   
   **1. Closure within a lambda.** Fixed: the innermost construct now decides, 
so a declared property in a closure within a lambda goes through the accessor 
for reads and writes, and a lambda within a closure still uses the field. 
`testPropertyInClosureWithinLambdaUsesTheAccessor` locks this in all three 
modes. One deviation is recorded in the NOTE: the simple name is not offered to 
the closure's delegate there (it behaves as `this.name`), because leaving it 
for the closure to resolve hits the GROOVY-12602 `ClassCastException` under 
`@CompileStatic`.
   
   **2. `++` / `--`.** I've taken your second option. The Terms no longer claim 
these are the same form of reference, static rule 4 and the "Prefix and postfix 
operations" section say what happens, and 
`testIncrementOfStaticAccessorIsNotACallOfTheTraitAccessor` locks the current 
results in all three modes, including the mixed `@CompileStatic` one. Increment 
and decrement of a trait's own fields are still rejected (GROOVY-6689), and I'd 
rather handle both together there than complete half of it here.
   
   **Other notes.**
   - The NOTE now lists the `@Virtual` cell for `@CompileStatic`.
   - GROOVY-12608 under `@CompileStatic` is locked (the lambda reads the 
accessor, so `1`), and since master returns `42` there I've added a 
`COMPATIBILITY.md` entry for it.
   - The customizer case is locked too. It is a little worse than "document or 
test": a plain lambda `() -> cnt` fails with `MissingFieldException` when 
`@CompileStatic` comes from a customizer. Master fails there as well, so it is 
recorded as an open cell, not a regression.
   - The `invokestatic` alignment for a super-trait accessor in a method body 
I'll leave for a follow-up, as you suggest.
   - I've held back the `COMPATIBILITY.md` entry for the GROOVY-12597 message 
until the backport decision is made.


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