Refactor if to when in dsl.kt
[no changelog]
This commit is contained in:
@@ -37,14 +37,11 @@ fun literal(
|
|||||||
|
|
||||||
|
|
||||||
private fun normalizeGeneric(argument: Type): Class<*> {
|
private fun normalizeGeneric(argument: Type): Class<*> {
|
||||||
return if (argument is Class<*>) {
|
return when (argument) {
|
||||||
argument
|
is Class<*> -> argument
|
||||||
} else if (argument is TypeVariable<*>) {
|
is TypeVariable<*> -> normalizeGeneric(argument.bounds[0])
|
||||||
normalizeGeneric(argument.bounds[0])
|
is ParameterizedType -> normalizeGeneric(argument.rawType)
|
||||||
} else if (argument is ParameterizedType) {
|
else -> Any::class.java
|
||||||
normalizeGeneric(argument.rawType)
|
|
||||||
} else {
|
|
||||||
Any::class.java
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user