ilPittiz opened a new issue, #14130:
URL: https://github.com/apache/grails-core/issues/14130

   ### Expected Behavior
   
   I tried to update my app from Grails 6.2.1 to 6.2.3.
   
   Declarations of Groovy closures involving generics were compiled without 
errors, e.g.
   ```
   Closure<T> closure = { T obj -> return doSomething(obj) }
   ```
   
   It seems the breaking change was introduced with Grails 6.2.2.
   
   ### Actual Behaviour
   
   `compileGroovy` task on startup fails.
   
   ### Steps To Reproduce
   
   1. download example app
   2. in `gradle.properties`, grails version is set to 6.2.1
   3. boot the app
   4. load http://localhost:8080/
   5. check the console, output is printed  
       ```
       [A, B]
       str
       ```
   6.  edit `gradle.properties`, uncomment the code to configure Grails to 
version 6.2.2
   7. reboot the app
   8. compilation errors are printed on console:
       ```
       > Task :compileGroovy FAILED
       1 actionable task: 1 executed
       startup failed:
       
/Users/Pittiz/github/Grails-generics/src/main/groovy/app/GenericWrapper.groovy: 
5: unable to resolve class T
        @ line 5, column 31.
                private static final Closure<T> noOpClosure = { T v -> return v 
}
                                        ^
       
       
/Users/Pittiz/github/Grails-generics/src/main/groovy/app/GenericWrapper.groovy: 
5: unable to resolve class T
        @ line 5, column 50.
          al Closure<T> noOpClosure = { T v -> ret
                                        ^
       
       /Users/Pittiz/github/Grails-generics/src/main/groovy/app/Utils.groovy: 
5: unable to resolve class T
        @ line 5, column 50.
          sure<String> SORT_CLOSURE = { T el -> re
                                        ^
       
       3 errors
       ```
   
   ### Environment Information
   
   - MacOS 15.3.2
   - JDK 11
   
   ### Example Application
   
   https://github.com/ilPittiz/Grails-closure-generics
   
   ### Version
   
   6.2.2


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