Skip to content

[question] how to use failsafe with kotlin #375

Open
@ntthaibk

Description

@ntthaibk

Hi folks, so I'm been using failsafe for java for quite a long time, now I'm moving to new project and decided to adopt it. But run into a problem

When I do Failsafe.with(retryPolicy).get {
...
}

kotlin compiler always say that Kotlin: Overload resolution ambiguity
Overload resolution ambiguity. All these functions match.
public open operator fun <T : Any!> get(supplier: CheckedSupplier<TypeVariable(T)!>!): TypeVariable(T)! defined in dev.failsafe.FailsafeExecutor
public open operator fun <T : Any!> get(supplier: ContextualSupplier<TypeVariable(T)!, TypeVariable(T)!>!): TypeVariable(T)! defined in dev.failsafe.FailsafeExecutor

How can I specify the CheckedSupplier in Kotlin?

Thanks and Best regard

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