def METHOD_NAME(self, type_hint: ast.expr) -> Attribute:
    """Convertes a Python/frontend type given as AST expression into xDSL type."""
    # Type hint should always be provided if this function is called.
    assert type_hint is not None
    # TODO: Type hint can be a Subscript AST node, for example
    # `Foo[Literal[2]]``. Support this in the future patches.
    if isinstance(type_hint, ast.Subscript):
        raise CodeGenerationException(
            self.file,
            type_hint.lineno,
            type_hint.col_offset,
            "Converting subscript type hints is not supported.",
        )
    # Type hint can also be a TypeAlias. For example, one can define
    # `foo = Foo[Literal[2]]`. This case also handles standard Python types, like
    # int, float, etc.
    if isinstance(type_hint, ast.Name):
        return self._convert_name(type_hint)
    raise CodeGenerationException(
        self.file,
        type_hint.lineno,
        type_hint.col_offset,
        f"Unknown type hint AST node '{type_hint}'.",
    )