Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] how to use failsafe with kotlin #375

Open
ntthaibk opened this issue Jan 11, 2024 · 0 comments
Open

[question] how to use failsafe with kotlin #375

ntthaibk opened this issue Jan 11, 2024 · 0 comments

Comments

@ntthaibk
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant