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
* Unwrap certain Java types to find the "real" class.
79
80
*/
80
81
fununwrapGenericType(type:JavaType): JavaType {
81
-
returnwhen(type) {
82
+
returnwhen(type) {
82
83
isParameterizedType-> {
83
84
val rawType = type.rawType
84
85
val genericType = options.genericWrappers.find { it.type == rawType } ?:return type
85
86
86
87
val typeArguments = type.actualTypeArguments
87
-
if(typeArguments.size <= genericType.index) {
88
+
if(typeArguments.size <= genericType.index) {
88
89
throwIndexOutOfBoundsException("Generic type '${TypeUtils.toString(type)}' does not have a type argument at index ${genericType.index}!")
89
90
}
90
91
@@ -96,15 +97,17 @@ open internal class GenericType(protected val mostSpecificType: JavaType, protec
96
97
97
98
return unwrapGenericType(unwrapsTo)
98
99
}
99
-
isClass<*> ->if(type.isPrimitive) Primitives.wrap(type) else type
100
+
isClass<*> ->if(type.isPrimitive) Primitives.wrap(type) else type
100
101
isTypeVariable<*> -> {
101
-
if(declaringType !isParameterizedType) {
102
+
if(declaringType !isParameterizedType) {
102
103
error("Could not resolve type variable '${TypeUtils.toLongString(type)}' because declaring type is not parameterized: ${TypeUtils.toString(declaringType)}")
103
104
}
104
105
105
-
unwrapGenericType(TypeUtils.determineTypeArguments(getRawClass(mostSpecificType), declaringType)[type] ?: error("No type variable found for: ${TypeUtils.toLongString(type)}"))
0 commit comments