arnaud.giuliani
09/06/2023, 2:56 PMKSValueParameter
class, I see that we have hasDefault
property to tell if we have default value. How do you get the default value expression behind?
class A( val i : Int = 0 )
How to get the default value of "i" here?ephemient
09/06/2023, 2:56 PMarnaud.giuliani
09/06/2023, 3:22 PMasdf asdf
09/06/2023, 3:43 PMkotlin-compiler-embeddable
as a library:
val KSPropertyDeclaration.defaultValue: String?
get() = (this as? KSPropertyDeclarationParameterImpl)
?.ktParameter
?.defaultValue
Which returns the raw PSI expression of the default valueJiaxiang
09/06/2023, 5:03 PM