-
-
Notifications
You must be signed in to change notification settings - Fork 970
Groovy 5 Compatibility #15183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 8.0.x
Are you sure you want to change the base?
Groovy 5 Compatibility #15183
Conversation
This reverts commit 457d6cd.
# Conflicts: # build.gradle # dependencies.gradle # grails-forge/build.gradle # grails-gradle/build.gradle
# Conflicts: # buildSrc/build.gradle # dependencies.gradle # grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy # grails-gradle/buildSrc/build.gradle
# Conflicts: # dependencies.gradle # gradle/test-config.gradle # grails-forge/settings.gradle # settings.gradle
|
9574fe8 - should be a comprehensive list of the remaining Groovy 5 issues which need to be addressed, not necessary the solutions. |
It seems the way we solved this was making it dynamically resolve, while before it was compilestatic. These don't seem like real solutions - the developer impact of method resolution is going to be very painful. |
|
@jamesfredley we should recreate this PR so your change shows correctly in the diff history. |
Why GormEntity Works but HibernateEntity Didn'tThe issue is NOT that Groovy 5 prohibits static methods in traits.
The Technical ProblemWhen a Java file in the same module imports a Groovy trait with static methods that return generic type parameters ( // Generated stub (INVALID Java)
@groovy.transform.Generated() static java.util.List<D> findAllWithSql(java.lang.CharSequence sql);
// ^ ERROR: non-static type variable D
// cannot be referenced from static contextIn Java, you cannot use a class-level type parameter ( Protential SolutionApproach: Remove Java Import via ReflectionInstead of removing the static methods from the trait, we modified Updated commit with this change: 425d2da Approach: move class locations to other modules or change Java Class to Groovy Class@jdaugherty these commits are not indented to be part of the real PR they are just a map for the real commit, it identifies everything that breaks trying to build. |
Supersedes #14737