Deprecate @higherkind & @extension for Either #272
Conversation
@Deprecated("Use the inline version. Hidden for binary compat", level = DeprecationLevel.HIDDEN) | ||
suspend inline fun <R> catch(f: suspend () -> R): Either<Throwable, R> = | ||
catch { f() } | ||
|
||
inline fun <R> catch(f: () -> R): Either<Throwable, R> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks the API in some places where you pass a suspend
lambda directly to the catch
function, I think the Kotlin compiler has the same limitation for suspend method references..
See arrow-kt/arrow-fx#354 as example of this breakage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks! 👏
So our approach for now is copy the (deprecated) kapt output, remove kapt, add meta?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 Thanks Simon
Looking at how arrow-kt/arrow-fx#354 fails this seems to cause some other problems as well :/ |
Yes exactly. That's the most graceful way to get rid of the things we want to get rid of for 1.0. Almost all signatures can be preserved, except |
I think this is fixable in some cases with a custom |
I originally thought so too, but we asked in #compiler on Kotlin Slack and doesn't seem to be the case. See https://youtrack.jetbrains.com/issue/KT-43872 The definition is valid, but the compiler doesn't know which one to pick from the user site :( |
Needs to be merged together with: