Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7-beta-1
-
None
-
None
Description
@Delegate seems to breaking the use of generics a bit.
This script goes through:
GroovyClassLoader gcl = new GroovyClassLoader() gcl.parseClass """ class A { List a } """ gcl.parseClass """ class B { List<String> a } """
This script fails:
GroovyClassLoader gcl = new GroovyClassLoader() gcl.parseClass """ class A { @Delegate List a // use of @Delegate List affects use of List<String> later } """ gcl.parseClass """ class B { List<String> a } """
with the error
script1253728549265.groovy: 3: The class java.util.List refers to the class java.util.List and uses 1 parameters, but the referred class takes no parameters
It seem to be happening because DelegateASTTransformation#nonGeneric(ClassNode) seems to be clearing the generics information from the ClassNodes statically loaded by org.codehaus.groovy.ast.ClassHelper