another question where i am not even sure where to begin searching.. is there a annotation that lets the user know that something else might be cleaner and replace code
that is less severe than
i have no idea how to use ReplaceWith though..
i wand to do this
id(SomeExpression)
->
+ someExpression
and ideally in the case that the lambda is specified do
id(someExpression) { moreExpressions }
->
add(someExpression) { moreExpressions }
Nikky
10/14/2018, 6:15 PM
is there some kind of printf like syntax that can be used in
ReplaceWith
that i do not know about ?
s
Sam
10/14/2018, 7:34 PM
@Nikky something like this helps IDE do the actual replacement
Copy code
@Deprecated("Use fooBar()",
replaceWith = ReplaceWith("fooBar()"))
fun fooBar( value : Int ): Unit = println( "old one" )
fun fooBar() = println( "new one" )
fun main( argv : Array<String> ) {
fooBar(1)
}
n
Nikky
10/14/2018, 7:39 PM
yeah so far i understand but that is plainly said.. useless without the ability to automatically refactor some parts of the expression.. what if you did not want to loose the argument ?
in your example it just gets dropped