play-monadic-actions
play-monadic-actions copied to clipboard
Compilation failures with v2.1 to v2.2 upgrade
I'm experiencing compilation problems when upgrading from v2.1.0 to v2.2.0.
These seem to be related to the addition of fBooleanToStepOps
implicit conversion.
Could you please provide some context on why the function was added?
I'm getting the following compilation error:
[error] Foo.scala:1:1: overloaded method ?| with alternatives:
[error] (failureThunk: => play.api.mvc.Result)io.kanaka.monadic.dsl.Step[Unit] <and>
[error] (failureHandler: Unit => play.api.mvc.Result)io.kanaka.monadic.dsl.Step[Unit]
[error] cannot be applied to (Throwable => play.api.mvc.Result)
[error] result <- myOp() ?| errorHandler("Failed do smth")
def myOp(): Future[Boolean] = ???
def errorHandler(msg: String): Throwable => Result = ???
I'm using the following import:
import io.kanaka.monadic.dsl.
With version v2.2.0 both futureToStepOps
and fBooleanToStepOps
can provide the required conversion whereas with v2.1.0 there's only futureToStepOps
.
Use of futureToStepOps
conversion results in StepOps[A, Throwable]
and fBooleanToStepOps
in StepOps[Unit, Unit]
, causing the compilation failure.
The code compiles with v2.2.0 if I e.g. shadow fBooleanToStepOps
as follows:
import io.kanaka.monadic.dsl.{fBooleanToStepOps => _, _}
can you please provide a full code example that was compiling with 2.1 and breaks with 2.2?
Can you please test again with 2.2.1
?
Still getting the same error with the new version:
[error] Foo.scala:1:1: overloaded method value ?| with alternatives:
[error] (failureThunk: => play.api.mvc.Result)io.kanaka.monadic.dsl.Step[Unit] <and>
[error] (failureHandler: Unit => play.api.mvc.Result)io.kanaka.monadic.dsl.Step[Unit]
[error] cannot be applied to (Throwable => play.api.mvc.Result)
[error] result <- myOp() ?| errorHandler("Failed do smth")
[error] ^