Don't recreate ir declarations to set body

This commit is contained in:
Mikhael Bogdanov
2018-05-03 11:01:10 +02:00
parent 35df7966cf
commit f0e4420259
@@ -161,20 +161,9 @@ open class DefaultArgumentStubGenerator constructor(val context: CommonBackendCo
irFunction.valueParameters.forEach { irFunction.valueParameters.forEach {
it.defaultValue = null it.defaultValue = null
} }
return if (functionDescriptor is ClassConstructorDescriptor)
listOf(irFunction, IrConstructorImpl( newIrFunction.body = body
startOffset = irFunction.startOffset, return listOf(irFunction, newIrFunction)
endOffset = irFunction.endOffset,
descriptor = descriptor as ClassConstructorDescriptor,
origin = DECLARATION_ORIGIN_FUNCTION_FOR_DEFAULT_PARAMETER,
body = body).apply { createParameterDeclarations() })
else
listOf(irFunction, IrFunctionImpl(
startOffset = irFunction.startOffset,
endOffset = irFunction.endOffset,
descriptor = descriptor,
origin = DECLARATION_ORIGIN_FUNCTION_FOR_DEFAULT_PARAMETER,
body = body).apply { createParameterDeclarations() })
} }
return listOf(irFunction) return listOf(irFunction)
} }