diff --git a/gradle.properties b/gradle.properties index e892bb1..e014b4e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=2.9.17 +projectVersion=2.9.18 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/util/KOptional.kt b/src/main/kotlin/ru/dbotthepony/kommons/util/KOptional.kt index 61a292d..265d8bf 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/util/KOptional.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/util/KOptional.kt @@ -59,7 +59,7 @@ class KOptional private constructor(private val _value: T, val isPresent: Boo } @Suppress("NOTHING_TO_INLINE") - inline fun orElse(value: T): T { + inline fun orElse(value: E): T { if (isPresent) { return this.value } else { @@ -67,7 +67,7 @@ class KOptional private constructor(private val _value: T, val isPresent: Boo } } - inline fun orElse(value: () -> T): T { + inline fun orElse(value: () -> E): T { if (isPresent) { return this.value } else { @@ -75,11 +75,11 @@ class KOptional private constructor(private val _value: T, val isPresent: Boo } } - infix fun or(value: KOptional): KOptional { + infix fun or(value: KOptional): KOptional { if (isPresent) { return this } else { - return value + return value as KOptional } }