From 3d1e058b59a964d8030a0055789c712a87730206 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 11 Mar 2024 20:09:41 +0700 Subject: [PATCH] Revert "Variant KOptional" This reverts commit ed1840a315c6d37848a0edf590f9d9d937b2f955. --- gradle.properties | 2 +- src/main/kotlin/ru/dbotthepony/kommons/util/KOptional.kt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index e014b4e..e892bb1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=2.9.18 +projectVersion=2.9.17 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 265d8bf..61a292d 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: E): T { + inline fun orElse(value: T): 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: () -> E): T { + inline fun orElse(value: () -> T): 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 as KOptional + return value } }