Kotlin: Suppress unused Property?

人盡茶涼 提交于 2019-12-06 20:08:11

问题


My source code is as follows:

There are warnings : Property '****' is never used.

I added "@Suppress("UNUSED_PARAMETER")", "@Suppress("UNUSED_PROPERTY_GETTER")", "@Suppress("UNUSED_PROPERTY_SETTER")",
however, none of them work.

How can I suppress this warning?


回答1:


Use @Suppress("unused") in order to suppress unused warning.

For those cases you can use the IDE. press alt+enter:



来源:https://stackoverflow.com/questions/43192281/kotlin-suppress-unused-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!