Open
Description
In v1
opt-in, a decorator setup_recursive_safe_function_for_generic()
is used to generate code for generic types such as Union
and Literal
.
However, it uses the type's __args__
to check for recursion.
This works fine currently, because while Union[str, int]
is valid, Literal[str, int]
is invalid.
As we add support for more generic types, it's conceivable that this might result in clashing and/or unexpected behavior. So creating an issue to address / look into this.