jamesfredley commented on PR #15557: URL: https://github.com/apache/grails-core/pull/15557#issuecomment-4845438797
### GROOVY-12106 fixed upstream - GraphQL trait-static workaround removed Paul King pushed the [GROOVY-12106](https://issues.apache.org/jira/browse/GROOVY-12106) port to `GROOVY_5_0_X` ([apache/groovy@67198d4](https://github.com/apache/groovy/commit/67198d4f5f17fcd56eae7ad968033633ae1b47bc)), and this time it lands the case Grails actually hits. **Why this commit fixes our case.** Earlier the STC fix was order-dependent: it only engaged after `TraitReceiverTransformer` rewrote the unqualified inherited static call into super-trait helper-static form, which is skipped when a sub-trait is transformed before the super-trait's `$Trait$Helper` exists - exactly our layout, since `Arguable`/`ComplexTyped` sort alphabetically before `ExecutesClosures`. The new commit makes `TraitReceiverTransformer.findConcreteMethod` resolve the original static **on the trait node even when `findHelper` returns null** (which is what happens on 5.0.x for the not-yet-lowered super trait), so the rewrite is no longer skipped in the sub-trait-first ordering. **The good part: it is in the published snapshot, so no local Groovy build is needed.** The fix is present in the latest published `5.0.7-SNAPSHOT` (build 20, `5.0.7-20260630.144435-20`), which is the artifact this PR resolves and the same one CI will resolve - so CI should compile green too, no `mavenLocal` / `GRAILS_INCLUDE_MAVEN_LOCAL` dance required anymore. **Verified locally against the published snapshot:** ``` ./gradlew :grails-data-graphql-core:compileGroovy --refresh-dependencies ``` ran the task fresh (not from cache) and `BUILD SUCCESSFUL`. The previously failing `Cannot find matching method ...#withDelegate(Closure, Object)` STC error is gone with the workaround removed. **Change.** Dropped the inlined `ExecutesClosures.withDelegate` bodies from `Arguable` and `ComplexTyped` and restored the plain inherited-static `withDelegate(closure, (Object) ...)` call (the `8.0.x` form). Behaviorally identical - `withDelegate` keeps the null-safe `DELEGATE_ONLY` logic and the `finally`-block delegate cleanup. The `GROOVY-12106` row has been removed from the workarounds table in the description above. -- 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]
