oracle/graal · error · LinkageError
Could not resolve type
Error message
Could not resolve type
What it means
Error "Could not resolve type " thrown in oracle/graal.
Source
Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:947
return lookupNonArrayType(name, accessingClass, resolve);
}
private JavaType lookupNonArrayType(String name, EspressoExternalResolvedInstanceType accessingClass, boolean resolve) {
assert !name.isEmpty() && name.charAt(0) != '[';
if (name.length() == 1) {
JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
return forPrimitiveKind(kind);
}
JVMCIError.guarantee(name.charAt(0) == 'L' && name.charAt(name.length() - 1) == ';', "Invalid type: " + name);
Value meta = invokeJVMCIHelper("lookupInstanceType", name, accessingClass.getMetaObject(), resolve);
if (meta.isNull()) {
if (resolve) {
/*
* lookupInstanceType should throw for unresolved symbols when resolve is true. It
* can currently return null for symbols unknown to Espresso; see GR-76549 for fixing
* that in the guest helper.
*/
throw new LinkageError("Could not resolve type " + name);
}
return UnresolvedJavaType.create(name);
}
return new EspressoExternalResolvedInstanceType(this, meta);
}
EspressoExternalResolvedPrimitiveType forPrimitiveKind(JavaKind kind) {
if (!kind.isPrimitive()) {
throw new IllegalArgumentException("Not a primitive kind: " + kind);
}
return forPrimitiveBasicType(kind.getBasicType());
}
private EspressoExternalResolvedPrimitiveType forPrimitiveBasicType(int basicType) {
if (primitives[basicType] == null) {
throw new IllegalArgumentException("No primitive type for basic type " + basicType);
}
return primitives[basicType];View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the condition reported by the error: Could not resolve type
- 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: Could not resolve type
When it happens
Trigger: Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:947 when the library encounters an invalid state.
Common situations: Occurs when a caller violates the contract guarded by this check: Could not resolve type
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/b4ceb714cde30eed.
Report an issue: GitHub.