Update KClass.isData KDoc to include info about data objects

^KT-58985 Fixed
Review: https://jetbrains.team/p/kt/reviews/10385

`isData` returns `true` for `data object`s even if kotlin-reflect
version is old (1.2.0), so it looks like we got correct `KClass.isData`
behaviour for "free". That's why this behaviour was never covered with
tests.

This commit updates the documentation and covers the behaviour described
in the KDoc with tests.
This commit is contained in:
Nikita Bobko
2023-05-30 15:10:50 +02:00
committed by Space Team
parent 13e2a3ae94
commit 4be7ac930b
2 changed files with 19 additions and 10 deletions
@@ -104,9 +104,10 @@ public actual interface KClass<T : Any> : KDeclarationContainer, KAnnotatedEleme
public val isSealed: Boolean
/**
* `true` if this class is a data class.
* See the [Kotlin language documentation](https://kotlinlang.org/docs/reference/data-classes.html)
* for more information.
* `true` if this class or object has the `data` keyword.
* For more information, see [data class](https://kotlinlang.org/docs/reference/data-classes.html) and
* [data object](https://kotlinlang.org/docs/object-declarations.html#data-objects)
* in the Kotlin language documentation.
*/
@SinceKotlin("1.1")
public val isData: Boolean