I want to rename a Kotlin type, leaving a deprecated typealias to allow existing code to compile.
typealias TestContext<F> = ContextBuilder<F>
@Deprecated("TestContext is now ContextBuilder",
replaceWith = ReplaceWith("ContextBuilder<F>"))
leads to TextContext<Unit> being replaced with ContextBuilder<F>
@Deprecated("TestContext is now ContextBuilder",
replaceWith = ReplaceWith("ContextBuilder"))
leads to TextContext<Unit> being replaced with ContextBuilder
How can I write the replaceWith expression so that IntelliJ replaces TextContext<Unit> with ContextBuilder<Unit>?
This is possible now! The ReplaceWith intention saves generic type arguments from Kotlin plugin v1.3.40 on (see change log).