JVM IR: always generate inline class constructor with name 'constructor-impl'
Previously it was 'constructor-' + hash in case inline class property is of inline class type. No new tests added because this change fixes the constructor name in `bytecodeListing/inlineClasses/inlineClassWithInlineClassUnderlyingType.kt`, which is now failing due to other reasons. #KT-37041 Fixed #KT-37186
This commit is contained in:
+8
-2
@@ -54,6 +54,14 @@ object InlineClassAbi {
|
|||||||
* to avoid clashes between overloaded methods.
|
* to avoid clashes between overloaded methods.
|
||||||
*/
|
*/
|
||||||
fun mangledNameFor(irFunction: IrFunction): Name {
|
fun mangledNameFor(irFunction: IrFunction): Name {
|
||||||
|
if (irFunction is IrConstructor) {
|
||||||
|
// Note that we might drop this convention and use standard mangling for constructors too, see KT-37186.
|
||||||
|
assert(irFunction.constructedClass.isInline) {
|
||||||
|
"Should not mangle names of non-inline class constructors: ${irFunction.render()}"
|
||||||
|
}
|
||||||
|
return Name.identifier("constructor-impl")
|
||||||
|
}
|
||||||
|
|
||||||
val suffix = when {
|
val suffix = when {
|
||||||
irFunction.fullValueParameterList.any { it.type.requiresMangling } ->
|
irFunction.fullValueParameterList.any { it.type.requiresMangling } ->
|
||||||
hashSuffix(irFunction)
|
hashSuffix(irFunction)
|
||||||
@@ -62,8 +70,6 @@ object InlineClassAbi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val base = when {
|
val base = when {
|
||||||
irFunction is IrConstructor ->
|
|
||||||
"constructor"
|
|
||||||
irFunction.isGetter ->
|
irFunction.isGetter ->
|
||||||
JvmAbi.getterName(irFunction.propertyName.asString())
|
JvmAbi.getterName(irFunction.propertyName.asString())
|
||||||
irFunction.isSetter ->
|
irFunction.isSetter ->
|
||||||
|
|||||||
Reference in New Issue
Block a user