Is it possible to suppress a warning on a type but...
# getting-started
c
Is it possible to suppress a warning on a type but not its content?
Copy code
class Foo { // I want to suppress that this is unused

    fun foo() {
        "foo" // but I still want the warning here
    }
}
p
Copy code
class Foo { // I want to suppress that this is unused

  fun foo() {
    "foo" // but I still want the warning here
  }
}

@Suppress("unused")
private fun useFoo(): Foo = TODO()
kodee intensifies
😱 3
w
A similar solution is to just reference the class in a KDoc comment in another class.
✅ 1