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:
+2
-5
@@ -211,11 +211,10 @@ fun IrClass.createParameterDeclarations() {
|
|||||||
fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = null) {
|
fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = null) {
|
||||||
assert(dispatchReceiverParameter == null)
|
assert(dispatchReceiverParameter == null)
|
||||||
|
|
||||||
dispatchReceiverParameter = WrappedReceiverParameterDescriptor().let {
|
dispatchReceiverParameter = IrValueParameterImpl(
|
||||||
IrValueParameterImpl(
|
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
origin ?: parentAsClass.origin,
|
origin ?: parentAsClass.origin,
|
||||||
IrValueParameterSymbolImpl(it),
|
IrValueParameterSymbolImpl(parentAsClass.thisReceiver!!.descriptor),
|
||||||
Name.special("<this>"),
|
Name.special("<this>"),
|
||||||
0,
|
0,
|
||||||
parentAsClass.defaultType,
|
parentAsClass.defaultType,
|
||||||
@@ -223,11 +222,9 @@ fun IrFunction.createDispatchReceiverParameter(origin: IrDeclarationOrigin? = nu
|
|||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
).apply {
|
).apply {
|
||||||
it.bind(this)
|
|
||||||
parent = this@createDispatchReceiverParameter
|
parent = this@createDispatchReceiverParameter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun IrClass.addFakeOverrides() {
|
fun IrClass.addFakeOverrides() {
|
||||||
fun IrDeclaration.toList() = when (this) {
|
fun IrDeclaration.toList() = when (this) {
|
||||||
|
|||||||
Reference in New Issue
Block a user