Hi. Can anyone help me with getting the value of e...
# ksp
b
Hi. Can anyone help me with getting the value of enum entries properties? I have
KSClassDeclaration
(
com.google.devtools.ksp.symbol.impl.binary.KSClassDeclarationDescriptorImpl
) which points to the
enum class Currency
, but I can't find a way to get the properties of the enum entries. I'd like to have something like 'Currency enum entry EUR
symbol
property is "€" and
prefixSymbol
is true'.
Copy code
enum class Currency(val symbol: String, val prefixSymbol: Boolean) {
    EUR("€", true),
    CZK("Kč", false),
}
d
If we have a file
Example.kt
:
val x = 2
In KSP's eyes, this has only one declaration which is a
KSPropertyDeclaration
for
x
. We can't normally get the value
2
b
@David Rawson Thanks! ❤️