FIR2IR: don't declare dispatch receiver for local functions
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5a3367e09c
commit
da6e96f4f1
+3
-1
@@ -306,7 +306,9 @@ class Fir2IrDeclarationStorage(
|
||||
)
|
||||
}
|
||||
}
|
||||
if (function !is FirAnonymousFunction && containingClass != null && !isStatic) {
|
||||
// See [LocalDeclarationsLowering]: "local function must not have dispatch receiver."
|
||||
val isLocal = function is FirSimpleFunction && function.isLocal
|
||||
if (function !is FirAnonymousFunction && containingClass != null && !isStatic && !isLocal) {
|
||||
dispatchReceiverParameter = declareThisReceiverParameter(
|
||||
symbolTable,
|
||||
thisType = containingClass.thisReceiver?.type ?: error("No this receiver"),
|
||||
|
||||
Reference in New Issue
Block a user