{"record":{"id":"e90991330d1b3dad","repo":"oracle/graal","slug":"unsupported-type-hierarchy-for-type-literal","errorCode":null,"errorMessage":"Unsupported type hierarchy for type literal.","messagePattern":"Unsupported type hierarchy for type literal\\.","errorType":"exception","errorClass":"AssertionError","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java","lineNumber":101,"sourceCode":"        rawType = (Class<T>) extractRawType(guestType);\n    }\n\n    public Class<T> getRawType() {\n        return rawType;\n    }\n\n    private static Type extractLiteralGuestType(@SuppressWarnings(\"rawtypes\") Class<? extends TypeLiteral> literalClass) {\n        Type superType = literalClass.getGenericSuperclass();\n        Type typeArgument;\n        while (true) {\n            if (superType instanceof ParameterizedType) {\n                ParameterizedType parametrizedType = (ParameterizedType) superType;\n                if (parametrizedType.getRawType() == TypeLiteral.class) {\n                    // found\n                    typeArgument = parametrizedType.getActualTypeArguments()[0];\n                    break;\n                } else {\n                    throw new AssertionError(\"Unsupported type hierarchy for type literal.\");\n                }\n            } else if (superType instanceof Class<?>) {\n                if (superType == TypeLiteral.class) {\n                    typeArgument = Object.class;\n                    break;\n                } else {\n                    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) {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java#L83-L119","documentation":"Error \"Unsupported type hierarchy for type literal.\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/TypeLiteral.java:101 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Unsupported type hierarchy for type literal.","solutions":["Fix the condition reported by the error: Unsupported type hierarchy for type literal.","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 hierarchy for type literal.","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"}