IR: Fixed bug with dispatch receiver parameter
When building dispatch receiver for newly created functions take ReceiverParameter from the parent class rather than create new
This commit is contained in:
+12
-15
@@ -211,21 +211,18 @@ fun IrClass.createParameterDeclarations() {
|
||||
fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = null) {
|
||||
assert(dispatchReceiverParameter == null)
|
||||
|
||||
dispatchReceiverParameter = WrappedReceiverParameterDescriptor().let {
|
||||
IrValueParameterImpl(
|
||||
startOffset, endOffset,
|
||||
origin ?: parentAsClass.origin,
|
||||
IrValueParameterSymbolImpl(it),
|
||||
Name.special("<this>"),
|
||||
0,
|
||||
parentAsClass.defaultType,
|
||||
null,
|
||||
false,
|
||||
false
|
||||
).apply {
|
||||
it.bind(this)
|
||||
parent = this@createDispatchReceiverParameter
|
||||
}
|
||||
dispatchReceiverParameter = IrValueParameterImpl(
|
||||
startOffset, endOffset,
|
||||
origin ?: parentAsClass.origin,
|
||||
IrValueParameterSymbolImpl(parentAsClass.thisReceiver!!.descriptor),
|
||||
Name.special("<this>"),
|
||||
0,
|
||||
parentAsClass.defaultType,
|
||||
null,
|
||||
false,
|
||||
false
|
||||
).apply {
|
||||
parent = this@createDispatchReceiverParameter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user