Kotlin: Suppress unused Property?

user3239558 picture user3239558 · Apr 3, 2017 · Viewed 11.1k times · Source

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?

enter image description here

Answer

Yoav Sternberg picture Yoav Sternberg · Apr 3, 2017

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

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