From 3848ac9cac6a2d27af727e63054f4b77b1b855ae Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 27 Dec 2019 23:22:07 +0100 Subject: [PATCH] JVM IR: never produce "$s" suffix for accessors in interfaces Not sure if this affects real code, but this could happen in erroneous cases such as in the subsequent commit, where it was a bit weird to see this suffix without any supercalls involved. --- .../kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt index f35e7d3da2c..fa0c71b0ecc 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt @@ -464,8 +464,7 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle // The only function accessors placed on interfaces are for private functions and JvmDefault implementations. // The two cannot clash. - parentAsClass.isJvmInterface && Visibilities.isPrivate(visibility) -> "" - parentAsClass.isJvmInterface && hasJvmDefault() -> "\$jd" + parentAsClass.isJvmInterface -> if (!Visibilities.isPrivate(visibility) && hasJvmDefault()) "\$jd" else "" // Accessor for _s_uper-qualified call superQualifier != null -> "\$s" + superQualifier.descriptor.name.asString().hashCode()