oracle/graal · error · IllegalArgumentException
Expected array annotation member type, got {}
Error message
Expected array annotation member type, got {} What it means
Error "Expected array annotation member type, got {}" thrown in oracle/graal.
Source
Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java:751
/**
* Converts a nested annotation value after verifying its concrete type against the enclosing
* member declaration.
*/
private JavaConstant guestAnnotationValue(AnnotationValue annotationValue, JavaType expectedType) {
if (!(expectedType instanceof ResolvedJavaType expectedAnnotationType)) {
throw new IllegalArgumentException("Expected resolved annotation member type, got " + expectedType);
}
validateAnnotationType(expectedAnnotationType, annotationValue.getAnnotationType(), "annotation member type");
return createGuestAnnotation(annotationValue);
}
/**
* Constructs a typed guest annotation array, promoting any deferred element failure to the
* member-level exception proxy required by the JDK annotation handler.
*/
private JavaConstant guestArrayValue(List<?> values, JavaType expectedType, JavaConstant annotationClass, JavaConstant memberName) {
if (!(expectedType instanceof ResolvedJavaType arrayType) || !arrayType.isArray()) {
throw new IllegalArgumentException("Expected array annotation member type, got " + expectedType);
}
ResolvedJavaType componentType = arrayType.getComponentType();
for (Object value : values) {
if (value instanceof ErrorElement) {
return toGuestAnnotationMemberValue(value, componentType, true, annotationClass, memberName);
}
}
if (componentType.isEnum()) {
JavaConstant enumClass = access.getProviders().getConstantReflection().asJavaClass(componentType);
ResolvedJavaType stringType = access.getProviders().getMetaAccess().lookupJavaType(String.class);
JavaConstant[] constantNames = new JavaConstant[values.size()];
for (int i = 0; i < values.size(); i++) {
if (!(values.get(i) instanceof EnumElement enumElement)) {
throw new IllegalArgumentException("Expected enum annotation array element, got " + values.get(i));
}
if (!componentType.equals(enumElement.enumType)) {
throw new IllegalArgumentException("Unexpected enum type: " + enumElement.enumType.toJavaName());
}View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the condition reported by the error: Expected array annotation member type, got {}
- Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.
Example fix
Validate inputs and environment so that the failing condition does not occur: Expected array annotation member type, got {} When it happens
Trigger: Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java:751 when the library encounters an invalid state.
Common situations: Occurs when a caller violates the contract guarded by this check: Expected array annotation member type, got {}
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/fc9ffe30bcc89f64.
Report an issue: GitHub.