oracle/graal · error · IllegalArgumentException

Expected guest annotation member value object, got {}

Error message

Expected guest annotation member value object, got {}

What it means

Error "Expected guest annotation member value object, 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:874

                }
                continue;
            }
            Value memberValue;
            if (guestMemberValue.isNull()) {
                /* Guest module encapsulation prevented reflection; Espresso interop can invoke public members directly. */
                try {
                    memberValue = annotation.invokeMember(memberName);
                } catch (PolyglotException e) {
                    Value guestException = e.isGuestException() ? e.getGuestObject() : null;
                    if (!recordGuestAnnotationFailure(elements, memberName, guestException, returnType)) {
                        throw e;
                    }
                    continue;
                }
            } else if (guestMemberValue instanceof EspressoExternalObjectConstant objectConstant) {
                memberValue = objectConstant.getValue();
            } else {
                throw new IllegalArgumentException("Expected guest annotation member value object, got " + guestMemberValue);
            }
            elements.put(memberName, guestAnnotationMemberValueAsHost(memberValue, returnType));
        }
        return new AnnotationValue(actualAnnotationType, elements);
    }

    /**
     * Recognizes a standard guest annotation failure and records its JVMCI representation. An
     * incomplete annotation is represented by leaving the member absent. Returns {@code false} for
     * exceptions unrelated to deferred annotation state so the caller can rethrow the original
     * boundary exception.
     */
    private boolean recordGuestAnnotationFailure(Map<String, Object> elements, String memberName, Value guestException, JavaType expectedType) {
        if (guestException == null || guestException.isNull()) {
            return false;
        }
        Value metaObject = guestException.getMetaObject();
        if (metaObject == null || metaObject.isNull()) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Expected guest annotation member value object, got {}
  2. 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 guest annotation member value object, got {}

When it happens

Trigger: Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalHostProxies.java:874 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Expected guest annotation member value object, got {}


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/f96e1b7150d9b72d. Report an issue: GitHub.