{"record":{"id":"598dcd7a9ca6d7fe","repo":"oracle/graal","slug":"unsupported-type-type","errorCode":null,"errorMessage":"Unsupported type: ${type}","messagePattern":"Unsupported type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java","lineNumber":126,"sourceCode":"                    superType = ((Class<?>) superType).getGenericSuperclass();\n                }\n            } else {\n                throw new AssertionError(\"Unsupported type hierarchy for type literal.\");\n            }\n        }\n        return typeArgument;\n    }\n\n    private static Class<?> extractRawType(Type type) {\n        Class<?> rawType;\n        if (type instanceof Class) {\n            rawType = (Class<?>) type;\n        } else if (type instanceof ParameterizedType) {\n            rawType = (Class<?>) ((ParameterizedType) type).getRawType();\n        } else if (type instanceof GenericArrayType) {\n            rawType = arrayTypeFromComponentType(extractRawType(((GenericArrayType) type).getGenericComponentType()));\n        } else {\n            throw new IllegalArgumentException(\"Unsupported type: \" + type);\n        }\n        return rawType;\n    }\n\n    /**\n     * This method can be used to obtain the reified type literal matching the class type parameter\n     * of a mapped foreign object at the given class generic type argument index. The primary use\n     * case is a parameterized host class which is custom mapped to a type in an embedded Espresso\n     * context.\n     *\n     * <p>\n     * <b>Example of a custom parameterized host class that is type mapped to a guest class:</b>\n     * {@link TypeLiteralSnippets}\n     *\n     * @param foreignObject the type-mapped foreign object\n     * @param typeArgumentIndex the type argument index\n     * @param <T> the generic type\n     * @return the type literal","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java#L108-L144","documentation":"Error \"Unsupported type: ${type}\" thrown in oracle/graal.","triggerScenarios":"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.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Unsupported type: ${type}","solutions":["Fix the condition reported by the error: Unsupported type: ${type}","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: Unsupported type: ${type}","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-15T22:17:37.221Z"}