-
Notifications
You must be signed in to change notification settings - Fork 465
Open
Labels
recipeRequested RecipeRequested Recipe
Description
What problem are you trying to solve?
Support trivial replacements built into the Kotlin language, but then scaled up through recipes, as per:
- https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-deprecated/
- Support recipe development using Kotlin's Deprecated annotation
replaceWith
rewrite-kotlin#25
Describe the situation before applying the recipe
Any usage of these deprecated methods
@Deprecated(
"orNone is being renamed to getOrNone to be more consistent with the Kotlin Standard Library naming",
ReplaceWith("getOrNone()")
)
public fun orNone(): Option<B> = getOrNone()
@Deprecated(
DeprMsg + "Use isLeft on Either after refactoring",
ReplaceWith("toEither().isLeft()")
)
public val isInvalid: Boolean =
fold({ true }, { false })
@Deprecated(
DeprMsg + "Use left instead to construct the equivalent Either value",
ReplaceWith("this.left()", "arrow.core.left")
)
public inline fun <E> E.invalid(): Validated<E, Nothing> =
Invalid(this)
Describe the situation after applying the recipe
Those usages converted to their suggested replacements.
Have you considered any alternatives or workarounds?
Generate recipes based on such patterns identified in well known libraries; not as usable or easily updated.
Any additional context
We already have similar support for Java's @InlineMe`; we can copy the same approach here.
Metadata
Metadata
Assignees
Labels
recipeRequested RecipeRequested Recipe
Type
Projects
Status
Recipes Wanted