Upgrade to Gradle 8.10, Kotlin 2.0.20, reduce warnings

This commit is contained in:
Edwin Jakobs
2024-08-25 09:39:18 +02:00
parent 5b6f2ec1ff
commit 8a4a85d333
37 changed files with 133 additions and 81 deletions

View File

@@ -5,7 +5,9 @@ plugins {
}
tasks.withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}
tasks.test {

View File

@@ -88,7 +88,7 @@ fun Element.div(vararg classes: String, init: Div.() -> Unit): Div {
}
inline fun <reified T : TextElement> Element.textElement(classes: Array<out String>, init: T.() -> String): T {
val te = T::class.java.newInstance()
@Suppress("DEPRECATION") val te = T::class.java.newInstance()
te.classes.addAll(classes.map { ElementClass(it) })
te.text(te.init())
append(te)

View File

@@ -7,7 +7,7 @@ import kotlin.reflect.full.declaredMemberProperties
fun watchHash(toHash: Any): Int {
var hash = 0
for (property in toHash::class.declaredMemberProperties) {
val v = ((property as KProperty1<Any, Any?>).getter).invoke(toHash)
@Suppress("UNCHECKED_CAST") val v = ((property as KProperty1<Any, Any?>).getter).invoke(toHash)
if (v is KProperty0<*>) {
val pv = v.get()
hash = 31 * hash + (pv?.hashCode() ?: 0)