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 17, 2024
1 parent 6adbaf2 commit 239067d
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 239067d

Please sign in to comment.