Skip to content

Commit

Permalink
Handle JvmName in annotation classes
Browse files Browse the repository at this point in the history
(cherry picked from commit 9eae2ee)
  • Loading branch information
ting-yuan authored and KSP Auto Pick committed Oct 18, 2024
1 parent 057675d commit a1fbd18
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,6 @@ class ResolverAAImpl(

// TODO: handle library symbols
override fun getJvmName(accessor: KSPropertyAccessor): String {
if (accessor.receiver.closestClassDeclaration()?.classKind == ClassKind.ANNOTATION_CLASS) {
return accessor.receiver.simpleName.asString()
}

val symbol: KaPropertyAccessorSymbol? = when (accessor) {
is KSPropertyAccessorImpl -> accessor.ktPropertyAccessorSymbol
else -> null
Expand All @@ -482,6 +478,10 @@ class ResolverAAImpl(
return it
}

if (accessor.receiver.closestClassDeclaration()?.classKind == ClassKind.ANNOTATION_CLASS) {
return accessor.receiver.simpleName.asString()
}

val prefix = if (accessor is KSPropertyGetter) {
"get"
} else {
Expand Down

0 comments on commit a1fbd18

Please sign in to comment.