https://kotlinlang.org logo
#ksp
Title
# ksp
r

Roberto Leinardi

07/19/2022, 2:41 PM
Hi everyone, quick question: is it currently possible to read the default value of a property of a data class? For example, if I have the following data class annotated with `@MyAnnotation`:
Copy code
@MyAnnotation
data class MyDataClass(
    val foo: Boolean = true,
    val bar: Int = 123,
    val buz: String? = "abc",
)
Is it possible to get the default values out of the
KSPropertyDeclaration
or in some other way?
j

Jiaxiang

07/19/2022, 5:30 PM
No, only default value in annotation arguments are available.
👍 1