Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix jvm name for annotation values #1727

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ class ResolverAAImpl(

// TODO: handle @JvmName annotations, mangled names
override fun getJvmName(accessor: KSPropertyAccessor): String? {
if (accessor.receiver.closestClassDeclaration()?.classKind == ClassKind.ANNOTATION_CLASS) {
return accessor.receiver.simpleName.asString()
}
val prefix = if (accessor is KSPropertyGetter) {
"get"
} else {
Expand Down
3 changes: 3 additions & 0 deletions test-utils/testData/api/mangledNames.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
// inlineReturningFun -> inlineReturningFun-HRn7Rpw
// internalInlineReceivingFun -> internalInlineReceivingFun-E03SJzc$mainModule
// internalInlineReturningFun -> internalInlineReturningFun-HRn7Rpw$mainModule
// mainPackage.Anno -> declarations
// get-a -> a
// mainPackage.AbstractKotlinClass -> declarations
// get-abstractVar -> getAbstractVar
// set-abstractVar -> setAbstractVar
Expand Down Expand Up @@ -151,6 +153,7 @@ class Foo {
internal fun internalInlineReturningFun(): Inline1 = TODO()
}

annotation class Anno(val a: String)
abstract class AbstractKotlinClass {
abstract var abstractVar:String
abstract val abstractVal:String
Expand Down