I've just tried to upgrade from 1.1.6-alpha.49 to ...
# arrow
n
I've just tried to upgrade from 1.1.6-alpha.49 to 1.1.6-alpha.70 and there are compilation errors on
recover()
calls like: None of the following functions can be called with the arguments supplied. I just can't figure out what change between these version that causes the problem... Thanks.
s
Hey @Norbi, Can you perhaps share a snippet? We've simplified some of the functions, but it should not result in any issues 🤔
The signature didn't change, but the parameter names. Sorry this was indeed breaking in the
alpha
, we had some inconsistencies in the parameter names and we aligned them. So if you're using named parameters for the lambdas you need to update accordingly.
Copy code
fun Raise<String>.failure(): Int = raise("failure")

recover(
  block = { failure() },
  recover = { -1 }
) shouldBe -1
Here is the PR showing the alignment in the API and type argument names. https://github.com/arrow-kt/arrow/pull/2987 We followed naming from Kotlin Std which uses
block
for such lambda parameters.
n
Thanks, it compiles now 🙂 (I like to use explicit parameter names where multiple parameters are of function types, it is more readable IMO.)
s
My pleasure, sorry for the inconvenience and thank you for using and supporting us by using
alpha
and providing feedback 🙌