Skip to content

Commit a20a743

Browse files
committed
add deprecated typed failure
1 parent 5003937 commit a20a743

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

kmmresult/src/commonMain/kotlin/at/asitplus/KmmResult.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import kotlin.contracts.InvocationKind
1111
import kotlin.contracts.contract
1212
import kotlin.experimental.ExperimentalObjCName
1313
import kotlin.experimental.ExperimentalObjCRefinement
14+
import kotlin.jvm.JvmName
1415
import kotlin.jvm.JvmStatic
16+
import kotlin.jvm.JvmSynthetic
1517
import kotlin.native.HiddenFromObjC
1618
import kotlin.native.ObjCName
1719

@@ -243,6 +245,13 @@ private constructor(
243245
@JvmStatic
244246
fun failure(error: Throwable): KmmResult<Nothing> = KmmResult(error)
245247

248+
@HiddenFromObjC
249+
@JvmStatic
250+
@JvmName("typedFailure")
251+
@JvmSynthetic
252+
@Deprecated("Superfluous type argument", ReplaceWith("failure(error)"))
253+
fun <T> failure(error: Throwable): KmmResult<T> = failure(error)
254+
246255
/**
247256
* Returns a [KmmResult] equivalent of this Result
248257
*/

0 commit comments

Comments
 (0)