diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/reflect/AnnotationDependencyListener.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/reflect/AnnotationDependencyListener.java index b214d0eaa..4409675aa 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/reflect/AnnotationDependencyListener.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/reflect/AnnotationDependencyListener.java @@ -220,7 +220,8 @@ public class AnnotationDependencyListener extends AbstractDependencyListener { if (value == null) { value = methodDecl.getAnnotationDefault(); } - params.add(generateAnnotationValue(agent, pe, methodDecl.getResultType(), value)); + params.add(generateAnnotationValue(agent, pe, methodDecl.getResultType(), value) + .cast(methodDecl.getResultType())); } return pe.construct(className, params.toArray(new ValueEmitter[params.size()]));