Ademir Queiroga
03/26/2021, 6:30 PMKSName.asString()
. What is strange is that I had a working version of my processor but after a few changes in the project structure (moved classes do different packages and so on) this error is now happening.
I am basically trying to get the qualified name or the simple name of a Kotlin annotation class.
Basically this is the code:
annotation as KSAnnotation
val declaration = annotation.annotationType.resolve().declaration
val qualifiedName = (declaration.qualifiedName ?: declaration.simpleName).asString()
val className = ClassName.bestGuess(qualifiedName)
If I print declaration
I can already see the string “Error type synthetic declaration”Ademir Queiroga
03/26/2021, 6:31 PMyigit
03/26/2021, 6:32 PMyigit
03/26/2021, 6:32 PMAdemir Queiroga
03/26/2021, 6:38 PMAdemir Queiroga
03/26/2021, 6:39 PMyigit
03/26/2021, 6:40 PMAdemir Queiroga
03/26/2021, 6:41 PMAdemir Queiroga
03/26/2021, 6:43 PMprintln()
and the logger provided in the init()
but no luck. I am throwing exceptions as a form of logyigit
03/26/2021, 7:12 PMAdemir Queiroga
03/26/2021, 7:13 PMAdemir Queiroga
03/26/2021, 7:14 PMyigit
03/26/2021, 7:16 PMAdemir Queiroga
03/26/2021, 7:18 PM