Skip to content

Commit

Permalink
Fix bug related causing ksp processor to fail when enums are used
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Jun 21, 2024
1 parent 42f4fc6 commit 21fc31e
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,12 @@ private fun KSTypeReference.dataClassType(rootType: KSClassDeclaration): TypeNam

else -> {
val declaration = resolvedType.declaration
if (declaration is KSClassDeclaration && declaration.classKind == ClassKind.ANNOTATION_CLASS) {
if (resolvedType.isMappedAnnotation(rootType)
|| (resolvedType.declaration as? KSClassDeclaration)?.classKind == ClassKind.ENUM_CLASS
) {
ClassName("", declaration.simpleName.asString())
} else {
KSAnnotation::class.asClassName()
}
if (resolvedType.isMappedAnnotation(rootType)
|| (resolvedType.declaration as? KSClassDeclaration)?.classKind == ClassKind.ENUM_CLASS
) {
ClassName("", declaration.simpleName.asString())
} else {
error("Unexpected type: $this")
KSAnnotation::class.asClassName()
}
}
}
Expand Down

0 comments on commit 21fc31e

Please sign in to comment.