I can reproduce this bug, too.
It appears from time to time in my groovy project, when I'm trying to compile certain classes.
I have not fully identified what classes cause this bug to appear, so I can't attach another example.
Rebuilding the whole project helps though.
Below is my setup and how I was able to reproduce the bug, using the files Jay provided.
I added an import to 'groovy.transform.Immutable' in Shares.groovy and uncommented the line in TestCRDConnector.groovy.
$ uname -a
Linux box 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
$ groovyc -version
Groovy compiler version 1.8.0
Copyright 2003-2010 The Codehaus. http://groovy.codehaus.org/
$ groovyc Shares.groovy
$ groovyc TestCRDConnector.groovy
>>> a serious error occurred: BUG! exception in phase 'class generation' in source unit 'TestCRDConnector.groovy' Type is null. Most probably you let a transform reuse existing ClassNodes with generics information, that is now used in a wrong context.
same stacktrace as above