{"record":{"id":"fc9ffe30bcc89f64","repo":"oracle/graal","slug":"expected-array-annotation-member-type-got","errorCode":null,"errorMessage":"Expected array annotation member type, got {}","messagePattern":"Expected array annotation member type, got (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java","lineNumber":751,"sourceCode":"    /**\n     * Converts a nested annotation value after verifying its concrete type against the enclosing\n     * member declaration.\n     */\n    private JavaConstant guestAnnotationValue(AnnotationValue annotationValue, JavaType expectedType) {\n        if (!(expectedType instanceof ResolvedJavaType expectedAnnotationType)) {\n            throw new IllegalArgumentException(\"Expected resolved annotation member type, got \" + expectedType);\n        }\n        validateAnnotationType(expectedAnnotationType, annotationValue.getAnnotationType(), \"annotation member type\");\n        return createGuestAnnotation(annotationValue);\n    }\n\n    /**\n     * Constructs a typed guest annotation array, promoting any deferred element failure to the\n     * member-level exception proxy required by the JDK annotation handler.\n     */\n    private JavaConstant guestArrayValue(List<?> values, JavaType expectedType, JavaConstant annotationClass, JavaConstant memberName) {\n        if (!(expectedType instanceof ResolvedJavaType arrayType) || !arrayType.isArray()) {\n            throw new IllegalArgumentException(\"Expected array annotation member type, got \" + expectedType);\n        }\n        ResolvedJavaType componentType = arrayType.getComponentType();\n        for (Object value : values) {\n            if (value instanceof ErrorElement) {\n                return toGuestAnnotationMemberValue(value, componentType, true, annotationClass, memberName);\n            }\n        }\n        if (componentType.isEnum()) {\n            JavaConstant enumClass = access.getProviders().getConstantReflection().asJavaClass(componentType);\n            ResolvedJavaType stringType = access.getProviders().getMetaAccess().lookupJavaType(String.class);\n            JavaConstant[] constantNames = new JavaConstant[values.size()];\n            for (int i = 0; i < values.size(); i++) {\n                if (!(values.get(i) instanceof EnumElement enumElement)) {\n                    throw new IllegalArgumentException(\"Expected enum annotation array element, got \" + values.get(i));\n                }\n                if (!componentType.equals(enumElement.enumType)) {\n                    throw new IllegalArgumentException(\"Unexpected enum type: \" + enumElement.enumType.toJavaName());\n                }","sourceCodeStart":733,"sourceCodeEnd":769,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java#L733-L769","documentation":"Error \"Expected array annotation member type, got {}\" thrown in oracle/graal.","triggerScenarios":"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.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Expected array annotation member type, got {}","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."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Expected array annotation member type, got {}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}