leangen / geantyref

Advanced generic type reflection library with support for working with AnnotatedTypes (for Java 8+)
Apache License 2.0
99 stars 15 forks source link

Provide a more general type resolution facility #6

Closed kaqqao closed 5 years ago

kaqqao commented 5 years ago

Provide a way to fully or partially resolve a type in the context of another. E.g. given:

class A<T> {
    Set<T> get();
}

class B extends A<String> {}

there should be a way to resolve Set<T> in the context of B (without having a reference to the get method itself).

This aims to solve the issue outlined in #5

kaqqao commented 5 years ago

The relevant methods are GenericTypeReflector.resolveExactType (which throws an exception if an unresolvable variable is encountered) and GenericTypeReflector.resolveType (which allows partial resolution).