JVM_IR: Allow delegated companion objects.

This currently leads to a compilation error due to metadata
generation.
This commit is contained in:
Mads Ager
2019-06-03 10:55:41 +02:00
committed by Alexander Udalov
parent 4ddd9f081b
commit 71604851fe
2 changed files with 1 additions and 2 deletions
@@ -227,7 +227,7 @@ open class ClassCodegen protected constructor(
val descriptor = field.metadata?.descriptor
if (descriptor != null) {
val codegen = if (JvmAbi.isPropertyWithBackingFieldInOuterClass(descriptor)) {
val codegen = if (field.origin != IrDeclarationOrigin.DELEGATE && JvmAbi.isPropertyWithBackingFieldInOuterClass(descriptor)) {
companionObjectCodegen ?: error("Class with a property moved from the companion must have a companion:\n${irClass.dump()}")
} else this
codegen.visitor.serializationBindings.put(JvmSerializationBindings.FIELD_FOR_PROPERTY, descriptor, fieldType to fieldName)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
package test
interface T {