-
Notifications
You must be signed in to change notification settings - Fork 198
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
Failing GORM domain inheritance with Groovy 4: The interface XXX cannot be implemented more than once with different arguments 9.0.0-SNAPSHOT #1811
Labels
Comments
jamesfredley
changed the title
New Failing Tests on 9.0.0
New Failing Tests on grails-data-mapping:9.0.0-snapshot
Sep 12, 2024
jamesfredley
changed the title
New Failing Tests on grails-data-mapping:9.0.0-snapshot
Failing Groovy-5106 (domain inheritance) Tests on grails-data-mapping:9.0.0-snapshot
Sep 12, 2024
jamesfredley
changed the title
Failing Groovy-5106 (domain inheritance) Tests on grails-data-mapping:9.0.0-snapshot
Failing Domain inheritance Tests on grails-data-mapping:9.0.0-snapshot
Sep 12, 2024
Example decompiled domain classes with inheritance: |
Gradle Artifact Transforms rough POC based on:
this rough POC currently puts the Verifier class files from Gradle's copy of Groovy (3.0.21) into the Groovy jar. It should use alternate versions compiled from the latest Groovy 4.0.x.
|
jamesfredley
changed the title
Failing Domain inheritance Tests on grails-data-mapping:9.0.0-snapshot
GORM domain inheritance with Groovy 4: The interface XXX cannot be implemented more than once with different arguments
Oct 17, 2024
jamesfredley
changed the title
GORM domain inheritance with Groovy 4: The interface XXX cannot be implemented more than once with different arguments
Failing GORM domain inheritance with Groovy 4: The interface XXX cannot be implemented more than once with different arguments
Oct 19, 2024
jamesfredley
changed the title
Failing GORM domain inheritance with Groovy 4: The interface XXX cannot be implemented more than once with different arguments
Failing GORM domain inheritance with Groovy 4: The interface XXX cannot be implemented more than once with different arguments 9.0.0-SNAPSHOT
Oct 19, 2024
This is a blocker for Grails 7 release. |
Opened upstream groovy ticket: https://issues.apache.org/jira/browse/GROOVY-11508 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Domain inheritance can be solved in at least one of three ways.
The change on Groovy would be lines 367-368, going from exception to a warning output to console. After that change, the code with domain inheritance compiles, as it did in Groovy 3 and runs without issue. https://github.com/apache/groovy/blob/ab5a811f5bffecf439714bbc9b073c3f66acf42c/src/main/java/org/codehaus/groovy/classgen/Verifier.java#L350-L377
this has also come up on several other Grails modules and the changes to work around it could be undone if this happens.
findByNameAndAge("james", 56)
Groovy-5106 (domain inheritance) issues: https://issues.apache.org/jira/browse/GROOVY-5106
The interface GormEntity cannot be implemented more than once with different arguments: org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX> and org.grails.datastore.gorm.GormEntity<grails.gorm.tests.XXX>
This also applies to other projects with inheritance tests
https://github.com/search?q=org%3Agrails%20%2F*extends&type=code
https://github.com/search?q=org%3Agrails+%2F%2F%40Entity&type=code
I dug a bit more into a generated domain with a parent domain and each will have two generic traits with one trait implementing a generic interface and then the generic type parameter is used in many methods in GormEntity, which then forks out in a number of directions. Here is an very simplified view of what that looks like.
At least the first two traits and first interface will generate "The interface XXX cannot be implemented more than once with different arguments" error when the child extends the parent. The compiler stops at the first one it bumps into.
The text was updated successfully, but these errors were encountered: