JVM_IR: Avoid using parent name in name of captures.
If parent is an anonymous object that could lead to the use of names such as `$this$no name provided` which is invalid in dex files.
This commit is contained in:
+3
-5
@@ -776,11 +776,9 @@ class LocalDeclarationsLowering(
|
|||||||
if (isSpecial) asString().substring(1, asString().length - 1) else asString()
|
if (isSpecial) asString().substring(1, asString().length - 1) else asString()
|
||||||
|
|
||||||
private fun suggestNameForCapturedValue(declaration: IrValueDeclaration, existing: MutableSet<Name>): Name {
|
private fun suggestNameForCapturedValue(declaration: IrValueDeclaration, existing: MutableSet<Name>): Name {
|
||||||
val base = if (declaration.name.isSpecial) {
|
val base = if (declaration.name.isSpecial)
|
||||||
val oldName = declaration.name.stripSpecialMarkers()
|
declaration.name.stripSpecialMarkers()
|
||||||
val parentName = (declaration.parent as? IrDeclarationWithName)?.name?.stripSpecialMarkers()
|
else
|
||||||
if (parentName != null) "$oldName$$parentName" else oldName
|
|
||||||
} else
|
|
||||||
declaration.name.asString()
|
declaration.name.asString()
|
||||||
var chosen = base.synthesizedName
|
var chosen = base.synthesizedName
|
||||||
var suffix = 0
|
var suffix = 0
|
||||||
|
|||||||
Vendored
+3
-3
@@ -60,7 +60,7 @@ final class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1$1 {
|
|||||||
|
|
||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
public final class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1 {
|
public final class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1 {
|
||||||
synthetic final field $this$flowWith$inlined: flow.Flow
|
synthetic final field $this$inlined: flow.Flow
|
||||||
inner class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1
|
inner class flow/InnerObjectRetransformationKt$check$$inlined$flowWith$1
|
||||||
public method <init>(p0: flow.Flow): void
|
public method <init>(p0: flow.Flow): void
|
||||||
public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||||
@@ -128,7 +128,7 @@ final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1$1 {
|
|||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
public final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1 {
|
public final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1 {
|
||||||
synthetic final field $builderBlock$inlined: kotlin.jvm.functions.Function2
|
synthetic final field $builderBlock$inlined: kotlin.jvm.functions.Function2
|
||||||
synthetic final field $this$flowWith$inlined: flow.Flow
|
synthetic final field $this$inlined: flow.Flow
|
||||||
inner class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1
|
inner class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$1
|
||||||
public method <init>(p0: kotlin.jvm.functions.Function2, p1: flow.Flow): void
|
public method <init>(p0: kotlin.jvm.functions.Function2, p1: flow.Flow): void
|
||||||
public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||||
@@ -150,7 +150,7 @@ final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2$1 {
|
|||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
public final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2 {
|
public final class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2 {
|
||||||
synthetic final field $builderBlock$inlined: kotlin.jvm.functions.Function2
|
synthetic final field $builderBlock$inlined: kotlin.jvm.functions.Function2
|
||||||
synthetic final field $this$flowWith$inlined: flow.Flow
|
synthetic final field $this$inlined: flow.Flow
|
||||||
inner class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2
|
inner class flow/InnerObjectRetransformationKt$flowWith$$inlined$flow$2
|
||||||
public method <init>(p0: kotlin.jvm.functions.Function2, p1: flow.Flow): void
|
public method <init>(p0: kotlin.jvm.functions.Function2, p1: flow.Flow): void
|
||||||
public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
public @org.jetbrains.annotations.Nullable method collect(@org.jetbrains.annotations.NotNull p0: flow.FlowCollector, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||||
|
|||||||
@@ -19,10 +19,5 @@ fun box(): String {
|
|||||||
|
|
||||||
// One instance of each is in kotlin.Metadata.d2
|
// One instance of each is in kotlin.Metadata.d2
|
||||||
// 1 \(X\)
|
// 1 \(X\)
|
||||||
|
|
||||||
// JVM_TEMPLATES
|
|
||||||
// 1 \(Y\)
|
// 1 \(Y\)
|
||||||
|
// 4 \$this
|
||||||
// JVM_IR_TEMPLATES
|
|
||||||
// 5 \(Y\)
|
|
||||||
// 4 \$this\$\(Y\)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user