Kapt+JVM_IR: do not generate secondary constructor bodies
In addition to ceedad40f3, do not generate bodies of constructors which
delegate to super.
#KT-58226 Fixed
This commit is contained in:
committed by
Space Team
parent
ba08f2c08a
commit
530725c6bf
@@ -161,10 +161,8 @@ internal class BodyGenerator(
|
||||
|
||||
generateDelegatingConstructorCall(irBlockBody, ktConstructor)
|
||||
|
||||
if (context.configuration.generateBodies) {
|
||||
ktConstructor.bodyExpression?.let { ktBody ->
|
||||
createStatementGenerator().generateStatements(ktBody.statements, irBlockBody)
|
||||
}
|
||||
ktConstructor.bodyExpression?.let { ktBody ->
|
||||
createStatementGenerator().generateStatements(ktBody.statements, irBlockBody)
|
||||
}
|
||||
|
||||
return irBlockBody
|
||||
|
||||
+3
-1
@@ -295,7 +295,9 @@ internal class FunctionGenerator(declarationGenerator: DeclarationGenerator) : D
|
||||
}
|
||||
}.buildWithScope { irConstructor ->
|
||||
generateValueParameterDeclarations(irConstructor, ktParametersElement, null, ktContextReceiversElements)
|
||||
irConstructor.body = createBodyGenerator(irConstructor.symbol).generateBody(irConstructor)
|
||||
if (context.configuration.generateBodies) {
|
||||
irConstructor.body = createBodyGenerator(irConstructor.symbol).generateBody(irConstructor)
|
||||
}
|
||||
irConstructor.returnType = constructorDescriptor.returnType.toIrType()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user