https://kotlinlang.org logo
Title
v

Vaios Tsitsonis

06/08/2022, 6:31 AM
Hello! I have a class that I want to process and create a metadata class based on the field types. This class has an enum field. The enum declaration is located in a different gradle module. The problem is that the
KSDeclaration
of this enum does not contain the
ENUM
modifier (It has only the following modifiers:
PUBLIC
,
FINAL
). If I move the enum class into the same gradle module then the
KSDeclarartion
will have the correct modifiers. Is there some sort of limitation with multi-module projects or is it a bug?
a

Anton Popov

06/08/2022, 9:57 AM
I also recently experienced this issue. Seems like a bug, but there is a workaround:
declaration.classKind == ClassKind.ENUM_CLASS
v

Vaios Tsitsonis

06/08/2022, 10:03 AM
I ll try it. The problem with this workaround is that it can not work with sealed classes. I have a sealed class field too and ClassKind does not have a value for sealed classes :(
a

Anton Popov

06/08/2022, 4:34 PM
Found an old issue, left a comment @Jiaxiang
👍 1
j

Jiaxiang

06/09/2022, 12:14 AM
see my reply on Github.