You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Supertype lookups (findSupertype()) on a self-reference (ResolvedRecursiveType) return null #137
A self-reference (ResolvedRecursiveType) itself still exposes no supertypes: getParentClass() returns null and getImplementedInterfaces() an empty list (to avoid infinite loops). So findSupertype() / typeParametersFor() called on a self-reference return null, even though the type it represents has those supertypes.
#132 fixed this for self-references held as supertypes of other types (ResolvedObjectType / ResolvedInterfaceType accessors now return getActualType()), and MemberResolver.resolve() special-cases a self-reference as main type; but other callers holding a self-reference directly (e.g. one obtained via getTypeParameters()) still lose its supertypes.
Supertype lookups on a self-reference give the same results as for the type it represents (getActualType()).
Notes
Simplest approach: have ResolvedRecursiveType.findSupertype() (and possibly getParentClass() / getImplementedInterfaces()) delegate to getActualType(). Delegating the plain accessors is riskier: returning no supertypes is what currently terminates traversals of recursive types, and for expanding generic types (like C<T> extends Base<D<T>>, D<T> extends C<List<T>>) following actual types yields ever deeper types. Overriding only findSupertype() / typeParametersFor() would avoid that, since lookup by erased class terminates.
Activity