Skip to content

Commit

Permalink
Ouch! Kotlin internal compiler error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDoot committed Mar 18, 2019
1 parent c3ba16b commit 666f552
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/main/kotlin/frontier/skc/ParameterMappings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,37 @@ object ParameterMappings {

val PLAYER: ParameterMapping = matchOnType<Player> {
when {
it.findAnnotation<OrSource>() != null -> GenericArguments::playerOrSource
else -> GenericArguments::player
it.findAnnotation<OrSource>() != null -> { key ->
GenericArguments.playerOrSource(key)
}
else -> { key ->
GenericArguments.player(key)
}
}
}

val USER: ParameterMapping = matchOnType<User> {
when {
it.findAnnotation<OrSource>() != null -> GenericArguments::userOrSource
else -> GenericArguments::user
it.findAnnotation<OrSource>() != null -> { key ->
GenericArguments.userOrSource(key)
}
else -> { key ->
GenericArguments.user(key)
}
}
}

val STRING: ParameterMapping = matchOnType<String> {
when (it.findAnnotation<RemainingJoined>()?.raw) {
true -> GenericArguments::remainingRawJoinedStrings
false -> GenericArguments::remainingJoinedStrings
else -> GenericArguments::string
true -> { key ->
GenericArguments.remainingRawJoinedStrings(key)
}
false -> { key ->
GenericArguments.remainingJoinedStrings(key)
}
else -> { key ->
GenericArguments.string(key)
}
}
}

Expand Down

0 comments on commit 666f552

Please sign in to comment.