JVM_IR: generate "safe" names for functions in init blocks
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
lateinit var result1: String
|
||||
lateinit var result2: String
|
||||
|
||||
class Test(val x: String) {
|
||||
fun test(a: String) {
|
||||
if (result1 != a) throw AssertionError("result1: $result1")
|
||||
result2 = a
|
||||
}
|
||||
|
||||
init {
|
||||
fun test() {
|
||||
fun test1() {
|
||||
result1 = x
|
||||
}
|
||||
test1()
|
||||
}
|
||||
test()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val t = Test("OK")
|
||||
t.test("OK")
|
||||
|
||||
return result2
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
class C() {
|
||||
constructor(x: Int): this() {
|
||||
fun test() {
|
||||
fun test() {}
|
||||
}
|
||||
}
|
||||
|
||||
constructor(y: String): this() {
|
||||
fun test() {
|
||||
fun test() {}
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
fun test() {}
|
||||
}
|
||||
|
||||
init {
|
||||
fun test() {
|
||||
fun test() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
@kotlin.Metadata
|
||||
final class C$1$1 {
|
||||
public final static field INSTANCE: C$1$1
|
||||
inner (anonymous) class C$1
|
||||
inner (anonymous) class C$1$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class C$1 {
|
||||
public final static field INSTANCE: C$1
|
||||
inner (anonymous) class C$1
|
||||
inner (anonymous) class C$1$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class C$2$1 {
|
||||
public final static field INSTANCE: C$2$1
|
||||
inner (anonymous) class C$2
|
||||
inner (anonymous) class C$2$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class C$2 {
|
||||
public final static field INSTANCE: C$2
|
||||
inner (anonymous) class C$2
|
||||
inner (anonymous) class C$2$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class C$3$1 {
|
||||
public final static field INSTANCE: C$3$1
|
||||
inner (anonymous) class C$3
|
||||
inner (anonymous) class C$3$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class C$3 {
|
||||
public final static field INSTANCE: C$3
|
||||
inner (anonymous) class C$3
|
||||
inner (anonymous) class C$3$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class C$test$1 {
|
||||
public final static field INSTANCE: C$test$1
|
||||
inner (anonymous) class C$test$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public synthetic bridge method invoke(): java.lang.Object
|
||||
public final method invoke(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class C {
|
||||
inner (anonymous) class C$1
|
||||
inner (anonymous) class C$2
|
||||
inner (anonymous) class C$3
|
||||
inner (anonymous) class C$test$1
|
||||
public method <init>(): void
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
public method <init>(p0: int): void
|
||||
public final method test(): void
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
@kotlin.Metadata
|
||||
public final class C {
|
||||
public method <init>(): void
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
public method <init>(p0: int): void
|
||||
private final static method _init_$test-0$test(): void
|
||||
private final static method _init_$test-0(): void
|
||||
private final static method _init_$test-2$test-1(): void
|
||||
private final static method _init_$test-2(): void
|
||||
private final static method _init_$test-5(): void
|
||||
private final static method test$test-3(): void
|
||||
public final method test(): void
|
||||
private final static method test-5$test-4(): void
|
||||
}
|
||||
Reference in New Issue
Block a user