JVM IR: sanitize indy lambda proxy names correctly
In case there are several proxy functions for indy lambdas in the same container, its names are "...__proxy", "...__proxy-0", "...__proxy-1", ..., yet before this change, only the first one was sanitized. So if it's happening inside a constructor, `<init>` was left unrenamed which led to ClassFormatError. #KT-52040 Fixed
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// FULL_JDK
|
||||
// JVM_TARGET: 1.8
|
||||
// FILE: J.java
|
||||
|
||||
import java.util.function.*;
|
||||
|
||||
public class J {
|
||||
public static void f1(Supplier<Object> r) {}
|
||||
public static void f2(Supplier<Object> r) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class C private constructor() {
|
||||
companion object {
|
||||
fun x1() = J.f1(::C)
|
||||
fun x2() = J.f2(::C)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
@kotlin.Metadata
|
||||
synthetic final class C$Companion$x1$1 {
|
||||
// source: 'test.kt'
|
||||
enclosing method C$Companion.x1()V
|
||||
public final static field INSTANCE: C$Companion$x1$1
|
||||
inner (anonymous) class C$Companion$x1$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(): C
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final inner class C$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
synthetic final class C$Companion$x2$1 {
|
||||
// source: 'test.kt'
|
||||
enclosing method C$Companion.x2()V
|
||||
public final static field INSTANCE: C$Companion$x2$1
|
||||
inner (anonymous) class C$Companion$x2$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method invoke(): C
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final inner class C$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class C$Companion {
|
||||
// source: 'test.kt'
|
||||
inner (anonymous) class C$Companion$x1$1
|
||||
inner (anonymous) class C$Companion$x2$1
|
||||
inner (anonymous) class C$sam$java_util_function_Supplier$0
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final method x1(): void
|
||||
public final method x2(): void
|
||||
public final inner class C$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
synthetic final class C$sam$java_util_function_Supplier$0 {
|
||||
// source: 'test.kt'
|
||||
enclosing method C$Companion.x1()V
|
||||
private synthetic final field function: kotlin.jvm.functions.Function0
|
||||
inner (anonymous) class C$sam$java_util_function_Supplier$0
|
||||
method <init>(p0: kotlin.jvm.functions.Function0): void
|
||||
public synthetic final method get(): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class C {
|
||||
// source: 'test.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: C$Companion
|
||||
static method <clinit>(): void
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final inner class C$Companion
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
@kotlin.Metadata
|
||||
public final class C$Companion {
|
||||
// source: 'test.kt'
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
private synthetic final static method x1$_init___proxy(): C
|
||||
public final method x1(): void
|
||||
private synthetic final static method x2$_init___proxy-0(): C
|
||||
public final method x2(): void
|
||||
public final inner class C$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class C {
|
||||
// source: 'test.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: C$Companion
|
||||
static method <clinit>(): void
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final inner class C$Companion
|
||||
}
|
||||
Reference in New Issue
Block a user