tankistorep
10/12/2023, 10:00 AM@Supress
doesn't work - so
object SupressionNames {
const val MAGIC_NUMBER = "MAGIC_NUMBER"
}
// Another file somewhere
@Supress(SupressionNames.MAGIC_NUMBER)
fun foo(...) { ... }
If I define the constant without the object, then it works just fine. But I'm just curious - why doesn't it work when using an object? And is it good practice to do this in the first place? (Would love to see some reading material if anyone knows any!). Cheers!Hardik Trivedi
10/12/2023, 10:41 AM