[SLC] generate correct name for property assessors in case of JvmRecord
^KT-62357 Fixed
This commit is contained in:
committed by
Space Team
parent
5c71015b09
commit
44388ea15f
+7
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -95,8 +95,12 @@ internal class SymbolLightAccessorMethod private constructor(
|
|||||||
withPropertySymbol { propertySymbol ->
|
withPropertySymbol { propertySymbol ->
|
||||||
val accessorSymbol = propertySymbol.accessorSymbol
|
val accessorSymbol = propertySymbol.accessorSymbol
|
||||||
accessorSymbol.getJvmNameFromAnnotation(accessorSite.toOptionalFilter()) ?: run {
|
accessorSymbol.getJvmNameFromAnnotation(accessorSite.toOptionalFilter()) ?: run {
|
||||||
|
val outerClass = this@SymbolLightAccessorMethod.containingClass
|
||||||
val defaultName = propertySymbol.name.identifier.let {
|
val defaultName = propertySymbol.name.identifier.let {
|
||||||
if (this@SymbolLightAccessorMethod.containingClass.isAnnotationType) it else it.abiName()
|
if (outerClass.isAnnotationType || outerClass.isRecord)
|
||||||
|
it
|
||||||
|
else
|
||||||
|
it.abiName()
|
||||||
}
|
}
|
||||||
|
|
||||||
val visibility = if (!isGetter && propertySymbol.canHaveNonPrivateField)
|
val visibility = if (!isGetter && propertySymbol.canHaveNonPrivateField)
|
||||||
@@ -104,7 +108,7 @@ internal class SymbolLightAccessorMethod private constructor(
|
|||||||
else
|
else
|
||||||
propertySymbol.visibility
|
propertySymbol.visibility
|
||||||
|
|
||||||
propertySymbol.computeJvmMethodName(defaultName, this@SymbolLightAccessorMethod.containingClass, accessorSite, visibility)
|
propertySymbol.computeJvmMethodName(defaultName, outerClass, accessorSite, visibility)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public final class MyRec /* pkg.MyRec*/ {
|
|||||||
public final java.lang.String component1();// component1()
|
public final java.lang.String component1();// component1()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public final java.lang.String getName();// getName()
|
public final java.lang.String name();// name()
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public final pkg.MyRec copy(@org.jetbrains.annotations.NotNull() java.lang.String);// copy(java.lang.String)
|
public final pkg.MyRec copy(@org.jetbrains.annotations.NotNull() java.lang.String);// copy(java.lang.String)
|
||||||
|
|||||||
Reference in New Issue
Block a user