Skip to content

Commit

Permalink
Merge pull request #4 from rocketraman/rg/kotlin-1-6-metadata
Browse files Browse the repository at this point in the history
Target Kotlin 1.6 metadata for more backward compat
  • Loading branch information
deusaquilus authored Jan 25, 2024
2 parents ab379b7 + 3fd3ee1 commit 4043e2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ kotlin {
jvmToolchain(8)
}

// backward compat for users on older versions of Kotlin
// we use "data objects" in test code, so limit this to production code
tasks.named<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>("compileKotlin") {
compilerOptions.apply {
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_6)
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_6)
}
}

allprojects {

val varintName = project.name
Expand Down Expand Up @@ -119,4 +128,4 @@ allprojects {
sign(publishing.publications["mavenJava"])
}
}
}
}
4 changes: 2 additions & 2 deletions src/main/kotlin/io/exoquery/fansi/Fansi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,8 @@ final class Trie<T>(val strings: List<Pair<String, T>>){
when {
list.isEmpty() -> {
val allChildChars = continuations.map{ (a, _) -> a[0] }
val minVal = allChildChars.min()
val maxVal = allChildChars.max()
val minVal = allChildChars.minOrNull() ?: error("No chars")
val maxVal = allChildChars.maxOrNull() ?: error("No chars")

val arrVal = Array<Trie<T>?>(maxVal - minVal + 1, { null })
for( (char, ss) in continuations.groupBy { (a, _) -> a[0] } ){
Expand Down

0 comments on commit 4043e2d

Please sign in to comment.