Resolve generic property types in KotlinJsonAdapter.

This commit is contained in:
Eric Cochran
2018-04-03 17:37:38 -07:00
parent d045947ea7
commit dc450e6192
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) {