我在我的 API 中使用DeprecationLevel.ERROR:
@Deprecated(
message = "moved to def()",
replaceWith = ReplaceWith(expression = "def()"),
level = DeprecationLevel.ERROR)
fun abc() = def()
Run Code Online (Sandbox Code Playgroud)
我想要一个测试来确保调用者看到这个替换。例如,如果我不小心删除了该abc()方法,我的测试应该无法编译。
但我找不到编译这个的方法:
@Test
@Suppress("something")
fun deprecatedAbc() {
abc()
}
Run Code Online (Sandbox Code Playgroud)
例如,@Suppress("DEPRECATION")不起作用。有什么可以做的吗?
| 归档时间: |
|
| 查看次数: |
437 次 |
| 最近记录: |