Reports object that can be converted to data object
data object auto-generates toString, equals, hashCode and readResolve if
the object is annotated with java.io.Serializable
The inspection suggests to convert object to data object in 3 cases:
toString returns name of the classobject implements java.io.Serializableobject inherits sealed class/interfaceExample:
object Foo {
override fun toString(): String = "Foo"
}
After the quick-fix is applied:
data object Foo
This inspection only reports if the Kotlin language level of the project or module is 1.8 or higher