jamesfredley commented on code in PR #15557:
URL: https://github.com/apache/grails-core/pull/15557#discussion_r3178546656


##########
grails-views-gson/src/main/groovy/grails/plugin/json/view/api/internal/DefaultHalViewHelper.groovy:
##########
@@ -321,13 +321,13 @@ class DefaultHalViewHelper extends DefaultJsonViewHelper 
implements HalViewHelpe
                         def value = entityReflector.getProperty(object, 
propertyName)
                         if (value != null) {
 
-                            if (association instanceof ToMany && !(association 
instanceof Basic)) {
+                            if (association instanceof ToOne) {

Review Comment:
   Reverted in commit 73bd63c5477 - the cascade is now ToMany-first / 
ToOne-second again, matching the original 8.0.x order. The 'reorder for Groovy 
5 flow-typing narrowing' rationale from 153e14c5ad06 was the same upstream 
smart-cast misfire that hit `PersistentEntityCodec`: the compiler narrows 
`association` to `ToMany` in the else branch even when the else fired because 
the first `if` was false for an unrelated reason. `GROOVY-11983` 
(https://issues.apache.org/jira/browse/GROOVY-11983) was committed to 
`GROOVY_5_0_X` on 2026-05-03 (`65d16eb4`, port from master `af95d66d`) and 
lands in `5.0.6-SNAPSHOT` build #23 (`5.0.6-20260503.065745-23`). Verified the 
revert with `./gradlew :grails-views-gson:test` against build #23: BUILD 
SUCCESSFUL, all view rendering specs pass.



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