Refactor if to when in dsl.kt

[no changelog]
This commit is contained in:
Walker Selby
2023-10-26 16:49:09 +01:00
committed by nea
parent fb59b2afed
commit 710d9ec3f7

View File

@@ -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
} }
} }