4

I have the following data class annotated with @MyAnnotation:

@MyAnnotation
data class MyDataClass(
    val foo: Boolean = true,
    val bar: Int = 123,
    val buz: String? = "abc",
)

From the ClassDeclaration I can get all the KSPropertyDeclaration, and I'm able to get the simpleName and resolve the KSType, but I don't know how to get the default values of each property.

Roberto Leinardi
  • 10,641
  • 6
  • 65
  • 69

1 Answers1

1

Currently it's not supported by google, please check here https://github.com/google/ksp/issues/642

  • Please use comment for refering external links and write self contained amswers – Vencat Sep 01 '22 at 15:39
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32593824) – user-id-14900042 Sep 03 '22 at 08:07