aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/kotlin/moe/nea/firmament/commands/dsl.kt13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/commands/dsl.kt b/src/main/kotlin/moe/nea/firmament/commands/dsl.kt
index 60756f4..53a3622 100644
--- a/src/main/kotlin/moe/nea/firmament/commands/dsl.kt
+++ b/src/main/kotlin/moe/nea/firmament/commands/dsl.kt
@@ -37,14 +37,11 @@ fun literal(
private fun normalizeGeneric(argument: Type): Class<*> {
- return if (argument is Class<*>) {
- argument
- } else if (argument is TypeVariable<*>) {
- normalizeGeneric(argument.bounds[0])
- } else if (argument is ParameterizedType) {
- normalizeGeneric(argument.rawType)
- } else {
- Any::class.java
+ return when (argument) {
+ is Class<*> -> argument
+ is TypeVariable<*> -> normalizeGeneric(argument.bounds[0])
+ is ParameterizedType -> normalizeGeneric(argument.rawType)
+ else -> Any::class.java
}
}