Kapt+JVM_IR: generate delegated members correctly

Generate a declaration for each delegated member without body. If we
don't generate delegated declarations, subclasses will have incorrect IR
with unbound symbols in fake overrides.

 #KT-58027 Fixed
This commit is contained in:
Alexander Udalov
2023-04-17 22:37:29 +02:00
committed by Space Team
parent 5407ac1c72
commit bc7aea1426
7 changed files with 125 additions and 14 deletions
@@ -324,7 +324,9 @@ internal class ClassGenerator(
// TODO could possibly refer to scoped type parameters for property accessors
irFunction.returnType = delegatedDescriptor.returnType!!.toIrType()
irFunction.body = generateDelegateFunctionBody(irDelegate, delegatedDescriptor, delegateToDescriptor, irFunction)
if (context.configuration.generateBodies) {
irFunction.body = generateDelegateFunctionBody(irDelegate, delegatedDescriptor, delegateToDescriptor, irFunction)
}
}
private fun generateDelegateFunctionBody(