IR: propagate original declaration info via attributeOwnerId

For IrProperty, IrSimpleFunction we need to pass information about
original declaration to JVM_IR codegen. Instead of descriptors, use
the attributeOwnerId field.
This commit is contained in:
Georgy Bronnikov
2020-08-09 14:54:39 +03:00
parent 04d93dfbce
commit dafcdc527d
16 changed files with 79 additions and 8 deletions
@@ -572,6 +572,8 @@ fun IrFactory.createStaticFunctionWithReceivers(
}
if (copyMetadata) metadata = oldFunction.metadata
copyAttributes(oldFunction as? IrAttributeContainer)
}
}
@@ -549,6 +549,7 @@ private fun IrFunction.generateDefaultsFunctionImpl(
}
else -> throw IllegalStateException("Unknown function type")
}
(newFunction as? IrAttributeContainer)?.copyAttributes(this@generateDefaultsFunctionImpl as? IrAttributeContainer)
newFunction.copyTypeParametersFrom(this)
newFunction.parent = parent
newFunction.returnType = returnType.remapTypeParameters(classIfConstructor, newFunction.classIfConstructor)