diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index c62e6068d3c..89c75370074 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -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"), diff --git a/compiler/testData/codegen/box/closures/closureInsideConstrucor.kt b/compiler/testData/codegen/box/closures/closureInsideConstrucor.kt index f5215c56a61..38192dd47b0 100644 --- a/compiler/testData/codegen/box/closures/closureInsideConstrucor.kt +++ b/compiler/testData/codegen/box/closures/closureInsideConstrucor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //adopted snippet from kdoc open class KModel { val sourcesInfo: String diff --git a/compiler/testData/codegen/box/closures/localFunInInit.kt b/compiler/testData/codegen/box/closures/localFunInInit.kt index 0f81d73138b..12ef89bf126 100644 --- a/compiler/testData/codegen/box/closures/localFunInInit.kt +++ b/compiler/testData/codegen/box/closures/localFunInInit.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { val result: String init { diff --git a/compiler/testData/codegen/box/closures/localFunctionInInitBlock.kt b/compiler/testData/codegen/box/closures/localFunctionInInitBlock.kt index 236932f6625..00f939c4b4c 100644 --- a/compiler/testData/codegen/box/closures/localFunctionInInitBlock.kt +++ b/compiler/testData/codegen/box/closures/localFunctionInInitBlock.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR - lateinit var result1: String lateinit var result2: String diff --git a/compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt b/compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt index b030fb8fc50..5438d725fba 100644 --- a/compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt +++ b/compiler/testData/codegen/box/enum/kt7257_namedLocalFun.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class X { B { val value2 = "K" diff --git a/compiler/testData/codegen/box/functions/localFunctions/localFunctionInConstructor.kt b/compiler/testData/codegen/box/functions/localFunctions/localFunctionInConstructor.kt index c2938e53c40..5f294911561 100644 --- a/compiler/testData/codegen/box/functions/localFunctions/localFunctionInConstructor.kt +++ b/compiler/testData/codegen/box/functions/localFunctions/localFunctionInConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Test { val property:Int diff --git a/compiler/testData/codegen/box/objects/interfaceCompanionObjectReference.kt b/compiler/testData/codegen/box/objects/interfaceCompanionObjectReference.kt index 03a979c38e2..34e65303514 100644 --- a/compiler/testData/codegen/box/objects/interfaceCompanionObjectReference.kt +++ b/compiler/testData/codegen/box/objects/interfaceCompanionObjectReference.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NestedClassesInAnnotations -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt b/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt index 8bf2453608a..b86b48aee52 100644 --- a/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt +++ b/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME object O {