Skip to content

Ior.handleErrorWith() f parameter lacks a Right value #3658

@theycome

Description

@theycome

f cannot generate Ior.Right or Ior.Both since it is only passed a leftValue
Needs to be f: (A, B) -> Ior<D, B>

public inline fun <A, B, D> Ior<A, B>.handleErrorWith(combine: (B, B) -> B, f: (A) -> Ior<D, B>): Ior<D, B> {
contract {
callsInPlace(combine, InvocationKind.AT_MOST_ONCE)
callsInPlace(f, InvocationKind.AT_MOST_ONCE)
}
return when (this) {
is Left -> f(value)
is Right -> this
is Both -> when (val l = f(leftValue)) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions