-
Bug
-
Resolution: Done
-
Major
-
4.0.3.Final, 5.0.0.CR2
-
None
If you have a decorator as Groovy class like this:
@Decorator class TestDecorator implements DecoratedBeanInterface { @Inject @Delegate DecoratedBeanInterface delegate @Override String ping() { TestDecorator.toString() + delegate.ping() } }
you get a complaint as this:
org.jboss.weld.exceptions.DefinitionException: WELD-000061: The delegate type does not extend or implement the decorated type. Decorated type: interface groovy.lang.GroovyObject Decorator: Decorator [class org.jboss.weld.spock.auto.interceptorAndDecorator.TestDecorator] decorates [DecoratedBeanInterface, GroovyObject] with delegate type [DecoratedBeanInterface] and delegate qualifiers [@Default]
As a work-around you have to add @Typed(DecoratedBeanInterface) to the decorator class, but I think for better Groovy usability, GroovyObject should be ignored here by Weld.