Open
Description
Describe the bug
KTypeVariableName.toJTypeVariableName()
(and similarly JTypeVariableName.toKTypeVariableName()
) method can cause infinite recursion for type variable names that reference themselves (e.g. Enum<E extends Enum<E>>
).
Internally, there are methods to avoid this recursion when creating type variable names, e.g. JTypeVariableName#get()
and KTypeVariableName#get()
, but the public API doesn't have a way to avoid this recursion.
To Reproduce
- Get a
KTypeName
(orJTypeName
) of a type likeEnum<E extends Enum<E>>
- Call
KTypeName.toJTypeName()
(orJTypeName.toKTypeName()
) - Should fail with an infinite recursion
Expected behavior
The call should detect this and avoid the infinite recursion.
Additional context
Unfortunately, given the current API, I'm not sure there's a great way to work around this issue. Any ideas would be helpful.