fix(deps): update dependency com.michael-bull.kotlin-result:kotlin-result to v2.3.1#209
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
Conversation
9fef262 to
9c75b9d
Compare
9c75b9d to
b41d46f
Compare
f804f4f to
d34e813
Compare
063a284 to
50330a6
Compare
39d76c6 to
0bc203c
Compare
d36ce10 to
fab4c7e
Compare
4173ba3 to
b0a8876
Compare
7d1e836 to
97f8f87
Compare
20b04a9 to
704fbe5
Compare
734bab7 to
c5f75d8
Compare
c5f75d8 to
8206b40
Compare
8206b40 to
1182d24
Compare
12c24e7 to
0d27071
Compare
a65dbce to
1a6c70c
Compare
1a6c70c to
155e688
Compare
155e688 to
1e594ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.0.3→2.3.1Release Notes
michaelbull/kotlin-result (com.michael-bull.kotlin-result:kotlin-result)
v2.3.1Compare Source
b319b10)Iterable.tryRunningFoldIterable.tryRunningFoldIndexedIterable.tryRunningReduceIterable.tryRunningReduceIndexedIterable.tryScan(alias oftryRunningFold)Iterable.tryScanIndexed(alias oftryRunningFoldIndexed)4cfeec2)Iterable.partitionToIterable.combineErrTotryReducegeneric constraints generic constraints from<T, E>to<S, T : S, E>(1b84ca7)Iterable.tryReduceIterable.tryReduceIndexedFlow.tryReducev2.3.0Compare Source
753785c)@BindingDslmarker to prevent implicit outer-scopebind()(520d364)asynconCoroutineBindingScopeto auto-bindResult(103ac88)Warnings for unused
Resultreturn valuesThe library now compiles with
-Xreturn-value-checker=full, implicitly treating all public functions as@MustUseReturnValue. Consumers who enable-Xreturn-value-checker=checkin their own builds will receive warnings when they silently discard aResultreturned by this library.Side-effect functions whose return value exists only for optional chaining (
onOk,onErr,onEachOk,onEachErr, and their indexed/Flowvariants) are marked@IgnorableReturnValue.Preventing implicit outer-scope
bind()in nested bindingsWhen nesting
binding/coroutineBindingblocks with different error types,bind()can silently resolve to an outer scope. This compiles without warning but produces wrong control flow — theBindingExceptionbypasses the inner scope'stry/catchand short-circuits the outer scope instead:This release annotates both
BindingScopeandCoroutineBindingScopewith a shared@DslMarkerannotation, making implicit cross-scopebind()calls a compiler error. All four nesting combinations (binding/coroutineBindingin either direction) are caught. If you intentionally need to bind across scopes, explicit qualification (e.g.this@binding) is required.Auto-binding
asyncincoroutineBindingPreviously, the correct way to run concurrent operations in
coroutineBindingrequired placingbind()inside theasynclambda:This was non-obvious. A natural reading of the API led users to place
bind()outside, chaining.await().bind()at the call site:This compiles without warning, but chaining
.await()immediately afterasyncdefeats concurrency — each call suspends until completion before the next starts.This release adds an
asyncmember function onCoroutineBindingScopethat automatically bindsResult-returning lambdas. The member returnsDeferred<V>instead ofDeferred<Result<V, E>>, sobind()placement is handled for you and the sequential.await().bind()pattern above becomes a compiler error (there is noResultleft tobind()). The correct usage is now the natural one:Both coroutines launch immediately and run concurrently.
bind()is called inside eachasynccoroutine, cancelling the scope on the first error without waiting for the caller toawait. When the block does not return aResult, the standardCoroutineScope.asyncextension is used instead.v2.2.0Compare Source
Fallible Operations (
try*)Fallible collection operations now use a
tryprefix, inspired by Gleam's naming convention and mirroring stdlib's collection API more closely. Several new operations have also been added.mapResult*functions totryMap*,mapAlltotryMap,fold/foldRighttotryFold/tryFoldRight(d052cf5)@Deprecated+ReplaceWithfor easy migrationtryFind,tryFindLast,tryForEach,tryForEachIndexed,tryReduce,tryReduceIndexedforIterable(d2011f0)tryFilter,tryAssociate,tryFlatMap,tryGroupBy,tryPartition+ variants forIterable(f32985e)Flow Extensions
The
kotlin-result-coroutinesmodule now includes extensions for thekotlinx-coroutinesFlowtype, bringing the same Result-aware operations available onIterableto asynchronous streams. This was born out of the discussion in #78.Flowextensions forkotlin-coroutines(15d44a0)Result<Flow<V>, E>.toFlow()filterOk,filterErr,onEachOk,onEachErr,allOk,allErr,anyOk,anyErr,countOk,countErr,partition,combine,combineErrtryFilter,tryFilterNot,tryMap,tryMapNotNull,tryFlatMap,tryForEach,tryReduce,tryFold,tryFind,tryFindLast,tryAssociate,tryAssociateBy,tryAssociateWith,tryGroupBy,tryPartitionOther
onSuccess/onFailuretoonOk/onErr(a7c66c0)onEachOkIndexed,onEachErrIndexed) proved that theSuccess/Failurenaming becomes too verbose.Ok/Erris more readable.filterValues/filterErrorstofilterOk/filterErr(87f4c36)allOk/allErr/anyOk/anyErr/countOk/countErrconventionsonEachOk,onEachOkIndexed,onEachErr,onEachErrIndexedforIterable<Result>(a7c66c0)combineErrandcombineTo/combineErrToforIterable<Result>(1133e00,c06eeb3)coroutineBindingfailures by @dbottillo (d952b52)BindingExceptionpublic (549ed30)'internal' type accessed from public inline declarationwarning that will become an error in Kotlin 2.412ceff7)468b1a5)v2.1.0Compare Source
db45c67)Library consumers that directly access either
Result.valueorResult.error, e.g. in the situation they are extending the library to implement their own functionality, must now opt-in to unsafe access of these properties.Failure to do so will result in a compilation error:
There are three ways to opt-in:
On a function-level
On a file-level:
On a project-level in
build.gradle.ktskotlin { compilerOptions { optIn.add("com.github.michaelbull.result.annotation.UnsafeResultValueAccess") optIn.add("com.github.michaelbull.result.annotation.UnsafeResultErrorAccess") } }Configuration
📅 Schedule: Branch creation - "before 3am" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.