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

Mattias Reichel commented on GROOVY-11743:
------------------------------------------

This should replicate the error:
{code:java}
mattias@mattias-z4-linux:~/Projects/grails/grails-core$ cat test.groovy
trait GormEntity<D> implements GormEntityApi<D> {
    @Override
    D save() {
        println 'Save called'
    }
}

trait GormEntityApi<D> {
    abstract D save()
}
println 'done'

mattias@mattias-z4-linux:~/Projects/grails/grails-core$ groovy -v
Groovy Version: 4.0.28 JVM: 17.0.14 Vendor: BellSoft OS: Linux

mattias@mattias-z4-linux:~/Projects/grails/grails-core$ groovy test.groovy
done

mattias@mattias-z4-linux:~/Projects/grails/grails-core$ sdk use groovy 5.0.0
Using groovy version 5.0.0 in this shell.

mattias@mattias-z4-linux:~/Projects/grails/grails-core$ groovy test.groovy
Caught: BUG! exception in phase 'semantic analysis' in source unit 
'/home/mattias/Projects/grails/grails-core/test.groovy' ClassNode#getTypeClass 
for GormEntityApi called before the type class is set
BUG! exception in phase 'semantic analysis' in source unit 
'/home/mattias/Projects/grails/grails-core/test.groovy' ClassNode#getTypeClass 
for GormEntityApi called before the type class is set
 {code}

> Groovy 5 BUG! exception in phase 'semantic analysis'
> ----------------------------------------------------
>
>                 Key: GROOVY-11743
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11743
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Mattias Reichel
>            Assignee: Eric Milles
>            Priority: Major
>
> This code snippet compiles successfully with Groovy 4.0.28
> {code:java}
> trait GormEntity<D> implements GormEntityApi<D> {
>     @Override
>     D save() {
>         println 'Save called'
>     }
> }
> trait GormEntityApi<D> {
>     abstract D save()
> }
> println 'done'{code}
> However, with Groovy 5.0.0 I'm getting this error:
> {code:java}
> Caught: BUG! exception in phase 'semantic analysis' in source unit 
> '/mnt/c/Users/matti/Projects/github/grails-core/test.groovy' 
> ClassNode#getTypeClass for GormEntityApi called before the type class is set
> BUG! exception in phase 'semantic analysis' in source unit 
> '/mnt/c/Users/matti/Projects/github/grails-core/test.groovy' 
> ClassNode#getTypeClass for GormEntityApi called before the type class is set 
> {code}
>  



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

Reply via email to