JVM IR: copy property instead of field in MoveOrCopyCompanionObjectFieldsLowering

This way we're making sure that the copied field has some associated
property, where we can get the value of isConst flag from. That flag is
later used in StaticInitializersLowering to determine whether we need to
erase initializer of a field. The tests are unmuted because now the
initializer is correctly _not_ erased. (They were passing before
switching master to 1.4 because without
NoConstantValueAttributeForNonConstVals, we treated all static fields
with primitive/string values as const, and never erased initializers
because of that.)
This commit is contained in:
Alexander Udalov
2020-01-23 18:08:52 +01:00
parent e42a4b2fac
commit 00de5dae32
3 changed files with 23 additions and 14 deletions
@@ -1,5 +1,3 @@
// IGNORE_BACKEND: JVM_IR
package test
annotation class AString(val value: String)
@@ -22,4 +20,4 @@ interface Test {
const val vfloat: Float = 1.3.toFloat()
}
}
}