Merge pull request #475 from square/eric.resolve-generics

Resolve generic property types in KotlinJsonAdapter.
This commit is contained in:
Jesse Wilson
2018-04-04 01:18:31 -04:00
committed by GitHub
3 changed files with 52 additions and 3 deletions

View File

@@ -373,7 +373,8 @@ public final class Types {
return new Type[] { Object.class, Object.class };
}
static Type resolve(Type context, Class<?> contextRawType, Type toResolve) {
@CheckReturnValue // TODO(eric): Move this to internal Utils.
public static Type resolve(Type context, Class<?> contextRawType, Type toResolve) {
// This implementation is made a little more complicated in an attempt to avoid object-creation.
while (true) {
if (toResolve instanceof TypeVariable) {