[ 
https://issues.apache.org/jira/browse/GROOVY-11754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018907#comment-18018907
 ] 

Eric Milles commented on GROOVY-11754:
--------------------------------------

Your cast exception is here: 
https://github.com/matrei/grails-core/blob/9538ca0c458e08f175e57618d0cefc24b59467f4/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/GormEntityTransformation.groovy#L163

You can stop this by reversing the condition to "classNode.isEnum() || 
classNode instanceof InnerClassNode".  Or you could use "classNode.isEnum() || 
classNode.getOuterClass() != null".

The failure is related to GROOVY-7971 where we have instanceof and or operator.

> Compilation error: ClassCastException (unnamed module)
> ------------------------------------------------------
>
>                 Key: GROOVY-11754
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11754
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 5.0.1
>            Reporter: Mattias Reichel
>            Priority: Major
>
> To reproduce:
> {noformat}
> git clone https://github.com/matrei/grails-core.git
> cd grails-core
> git checkout groovy-5 # or 9538ca0c458e08f175e57618d0cefc24b59467f4
> ./gradlew grails-datastore-core:compileTestGroovy{noformat}
>  
> {noformat}
> Execution failed for task ':grails-datastore-core:compileTestGroovy'.
> > BUG! exception in phase 'semantic analysis' in source unit 
> > '/home/mattias/test/grails-core/grails-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/JpaMappingSyntaxTests.groovy'
> >  class org.codehaus.groovy.ast.ClassNode cannot be cast to class org.
> codehaus.groovy.ast.InnerClassNode (org.codehaus.groovy.ast.ClassNode and 
> org.codehaus.groovy.ast.InnerClassNode are in unnamed module of loader 
> org.gradle.internal.classloader.VisitableURLClassLoader @6cd5cc65) {noformat}
> Build scan: https://ge.grails.org/s/aq37mleqgllxw



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to