From 290aae1da9f8ab2b64e035f9b99840d97bc910f4 Mon Sep 17 00:00:00 2001 From: serge-slack Date: Mon, 23 Sep 2024 10:47:10 -0700 Subject: [PATCH] Add out variance to ApiResult.Failure generic type (#81) * Add out variance to ApiResult.Failure generic type * Update API --- eithernet/api/eithernet.klib.api | 2 +- .../src/commonMain/kotlin/com/slack/eithernet/ApiResult.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eithernet/api/eithernet.klib.api b/eithernet/api/eithernet.klib.api index cfb0d4b..3c19f15 100644 --- a/eithernet/api/eithernet.klib.api +++ b/eithernet/api/eithernet.klib.api @@ -69,7 +69,7 @@ sealed interface <#A: out kotlin/Any, #B: out kotlin/Any> com.slack.eithernet/Ap final fun networkFailure(okio/IOException): com.slack.eithernet/ApiResult.Failure.NetworkFailure // com.slack.eithernet/ApiResult.Companion.networkFailure|networkFailure(okio.IOException){}[0] final fun unknownFailure(kotlin/Throwable): com.slack.eithernet/ApiResult.Failure.UnknownFailure // com.slack.eithernet/ApiResult.Companion.unknownFailure|unknownFailure(kotlin.Throwable){}[0] } - sealed interface <#A1: kotlin/Any> Failure : com.slack.eithernet/ApiResult { // com.slack.eithernet/ApiResult.Failure|null[0] + sealed interface <#A1: out kotlin/Any> Failure : com.slack.eithernet/ApiResult { // com.slack.eithernet/ApiResult.Failure|null[0] final class <#A2: kotlin/Any> ApiFailure : com.slack.eithernet/ApiResult.Failure<#A2> { // com.slack.eithernet/ApiResult.Failure.ApiFailure|null[0] final fun withTags(kotlin.collections/Map, kotlin/Any>): com.slack.eithernet/ApiResult.Failure.ApiFailure<#A2> // com.slack.eithernet/ApiResult.Failure.ApiFailure.withTags|withTags(kotlin.collections.Map,kotlin.Any>){}[0] final val error // com.slack.eithernet/ApiResult.Failure.ApiFailure.error|{}error[0] diff --git a/eithernet/src/commonMain/kotlin/com/slack/eithernet/ApiResult.kt b/eithernet/src/commonMain/kotlin/com/slack/eithernet/ApiResult.kt index 467a89d..76afd45 100644 --- a/eithernet/src/commonMain/kotlin/com/slack/eithernet/ApiResult.kt +++ b/eithernet/src/commonMain/kotlin/com/slack/eithernet/ApiResult.kt @@ -65,7 +65,7 @@ public sealed interface ApiResult { } /** Represents a failure of some sort. */ - public sealed interface Failure : ApiResult { + public sealed interface Failure : ApiResult { /** * A network failure caused by a given [error]. This error is opaque, as the actual type could