JVM IR: rename private fields for properties with same name
This is needed to get rid of the code that appends "$companion" to properties moved from companion, because it caused inconsistencies in the ABI and in JVM signatures stored in the metadata
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A {
|
||||
val x = "outer"
|
||||
val y = "outer"
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val x = "companion"
|
||||
|
||||
const val y = "companion"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (A().x != "outer") return "Fail outer x"
|
||||
if (A().y != "outer") return "Fail outer y"
|
||||
if (A.x != "companion") return "Fail companion x"
|
||||
if (A.y != "companion") return "Fail companion y"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user