Skip to content

Commit

Permalink
Remove no longer needed cast with Kotlin 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Jul 5, 2024
1 parent 195386b commit d2424b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ gitHooks {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")

maven {
name = "Sonatype Snapshots"
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ plugins {
repositories {
google()
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
}

dependencies {
implementation(kotlin("gradle-plugin", version = "2.0.20-Beta1"))
implementation(kotlin("serialization", version = "2.0.20-Beta1"))
implementation(kotlin("gradle-plugin", version = "2.1.0-dev-758"))
implementation(kotlin("serialization", version = "2.1.0-dev-758"))

implementation("com.github.ben-manes", "gradle-versions-plugin", "0.50.0")
implementation("com.github.jakemarsden", "git-hooks-gradle-plugin", "0.0.2")
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
detekt = "1.23.6" # Note: Must update plugin versions in buildSrc/build.gradle.kts
dokka = "1.9.20" # Note: Must update plugin versions in buildSrc/build.gradle.kts
kotlin = "2.0.20-Beta1" # Note: Must update plugin versions in buildSrc/build.gradle.kts
kotlin = "2.1.0-dev-758" # Note: Must update plugin versions in buildSrc/build.gradle.kts

commons-validator = "1.9.0"
groovy = "3.0.22"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,14 @@ public abstract class ApplicationCommandRegistry : KordExKoinComponent {
}
}

@Suppress("DEPRECATION_ERROR")
private fun <C : Choice> BaseChoiceBuilder<*, C>.translate(command: ApplicationCommand<*>) {
choices = choices!!.map {
val (name, nameLocalizations) = command.localize(it.name)

when (val c = it as Choice) {
is Choice.NumberChoice -> Choice.NumberChoice(name, Optional(nameLocalizations), c.value)
is Choice.StringChoice -> Choice.StringChoice(name, Optional(nameLocalizations), c.value)
is Choice.IntegerChoice -> Choice.IntegerChoice(name, Optional(nameLocalizations), c.value)
when (it) {
is Choice.NumberChoice -> Choice.NumberChoice(name, Optional(nameLocalizations), it.value)
is Choice.StringChoice -> Choice.StringChoice(name, Optional(nameLocalizations), it.value)
is Choice.IntegerChoice -> Choice.IntegerChoice(name, Optional(nameLocalizations), it.value)
} as C
}.toMutableList()
}
Expand Down

0 comments on commit d2424b2

Please sign in to comment.