You need to tell how it needs to be replaced exactly… While I do not know why it was just completely deleted, I will show you what I mean instead:
If you would use the following instead:
@Deprecated("Old stuff", ReplaceWith("test2(i)"))
it will replace your test1(5)
call to test2(5)
correctly.
Note also that sometimes you may want to add the package name also if it isn’t that clear which replacement should take place, e.g.:
@Deprecated("Old stuff", ReplaceWith("org.example.test2(i)"))
// or just use:
@Deprecated("Old stuff", ReplaceWith("test2(i)", /* here come the imports */ "org.example.test2"))
You can also use static values in the replacement in case that is what you need.