Skip to content

Commit

Permalink
Handle JvmName in annotation classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ting-yuan committed Oct 18, 2024
1 parent c11ac8d commit 9eae2ee
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 9eae2ee

Please sign in to comment.