oracle/graal · error · IllegalArgumentException

Unsupported type: ${type}

Error message

Unsupported type: ${type}

What it means

Error "Unsupported type: ${type}" thrown in oracle/graal.

Source

Thrown at espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java:126

                    superType = ((Class<?>) superType).getGenericSuperclass();
                }
            } else {
                throw new AssertionError("Unsupported type hierarchy for type literal.");
            }
        }
        return typeArgument;
    }

    private static Class<?> extractRawType(Type type) {
        Class<?> rawType;
        if (type instanceof Class) {
            rawType = (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            rawType = (Class<?>) ((ParameterizedType) type).getRawType();
        } else if (type instanceof GenericArrayType) {
            rawType = arrayTypeFromComponentType(extractRawType(((GenericArrayType) type).getGenericComponentType()));
        } else {
            throw new IllegalArgumentException("Unsupported type: " + type);
        }
        return rawType;
    }

    /**
     * This method can be used to obtain the reified type literal matching the class type parameter
     * of a mapped foreign object at the given class generic type argument index. The primary use
     * case is a parameterized host class which is custom mapped to a type in an embedded Espresso
     * context.
     *
     * <p>
     * <b>Example of a custom parameterized host class that is type mapped to a guest class:</b>
     * {@link TypeLiteralSnippets}
     *
     * @param foreignObject the type-mapped foreign object
     * @param typeArgumentIndex the type argument index
     * @param <T> the generic type
     * @return the type literal

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Unsupported type: ${type}
  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: Unsupported type: ${type}

When it happens

Trigger: Thrown at espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java:126 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Unsupported type: ${type}


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