diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index dc8aa136fb8..6127597fcbe 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -847,7 +847,8 @@ class Fir2IrVisitor( val ownerFunction = symbol.owner if (ownerFunction.dispatchReceiverParameter != null) { dispatchReceiver = qualifiedAccess.findIrDispatchReceiver() - } else if (ownerFunction.extensionReceiverParameter != null) { + } + if (ownerFunction.extensionReceiverParameter != null) { extensionReceiver = qualifiedAccess.findIrExtensionReceiver() } this diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt index f54407ee4a5..0d64263789f 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt @@ -50,8 +50,7 @@ class JvmIrCodegenFactory(private val phaseConfig: PhaseConfig) : CodegenFactory val stubGenerator = irProviders.filterIsInstance().first() for (descriptor in symbolTable.wrappedTopLevelCallableDescriptors()) { - descriptor as WrappedDeclarationDescriptor<*> - val parentClass = stubGenerator.generateOrGetFacadeClass(descriptor) + val parentClass = stubGenerator.generateOrGetFacadeClass(descriptor as WrappedDeclarationDescriptor<*>) descriptor.owner.parent = parentClass ?: throw AssertionError("Facade class for ${descriptor.name} not found") } diff --git a/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionAll.kt b/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionAll.kt index aeae04f9d47..bd701f507a2 100644 --- a/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionAll.kt +++ b/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionAll.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class It { } diff --git a/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionHasNext.kt b/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionHasNext.kt index 3b7be492c73..fd0e52ec3f8 100644 --- a/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionHasNext.kt +++ b/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionHasNext.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class It { operator fun next() = 5 } diff --git a/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionNext.kt b/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionNext.kt index fbf25332d60..c7f347dd55c 100644 --- a/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionNext.kt +++ b/compiler/testData/codegen/box/controlStructures/forLoopMemberExtensionNext.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/defaultArguments/function/extentionFunctionInObject.kt b/compiler/testData/codegen/box/defaultArguments/function/extentionFunctionInObject.kt index 4a1ba7089a4..d16105ac6b3 100644 --- a/compiler/testData/codegen/box/defaultArguments/function/extentionFunctionInObject.kt +++ b/compiler/testData/codegen/box/defaultArguments/function/extentionFunctionInObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR object A { fun Int.foo(a: Int = 1): Int { return a diff --git a/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunction.kt b/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunction.kt index ceb83b72ed6..35a3e575fe4 100644 --- a/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunction.kt +++ b/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { fun Int.foo(a: Int = 1): Int { return a diff --git a/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDouble.kt b/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDouble.kt index e5b1991f8c9..a18b571e32b 100644 --- a/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDouble.kt +++ b/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDouble.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { fun Double.foo(a: Double = 1.0): Double { return a diff --git a/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDoubleTwoArgs.kt b/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDoubleTwoArgs.kt index 28ff207bea0..844f5e88ef4 100644 --- a/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDoubleTwoArgs.kt +++ b/compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionDoubleTwoArgs.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { fun Double.foo(a: Double = 1.0, b: Double = 1.0): Double { return a + b diff --git a/compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt b/compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt index 5c031a11d04..7d394cff6da 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME class A { private val sb: StringBuilder = StringBuilder() diff --git a/compiler/testData/codegen/box/extensionFunctions/virtual.kt b/compiler/testData/codegen/box/extensionFunctions/virtual.kt index 160f6081e15..cc8a6a72f1a 100644 --- a/compiler/testData/codegen/box/extensionFunctions/virtual.kt +++ b/compiler/testData/codegen/box/extensionFunctions/virtual.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Request(val path: String) { } diff --git a/compiler/testData/codegen/box/functions/defaultargs3.kt b/compiler/testData/codegen/box/functions/defaultargs3.kt index fa6214ec645..df755765779 100644 --- a/compiler/testData/codegen/box/functions/defaultargs3.kt +++ b/compiler/testData/codegen/box/functions/defaultargs3.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class C() { fun Any.toMyPrefixedString(prefix: String = "", suffix: String="") : String = prefix + " " + suffix diff --git a/compiler/testData/codegen/box/functions/invoke/extensionInvokeOnExpr.kt b/compiler/testData/codegen/box/functions/invoke/extensionInvokeOnExpr.kt index 88fff97e354..35496700fd7 100644 --- a/compiler/testData/codegen/box/functions/invoke/extensionInvokeOnExpr.kt +++ b/compiler/testData/codegen/box/functions/invoke/extensionInvokeOnExpr.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A class B { diff --git a/compiler/testData/codegen/box/innerNested/kt5363.kt b/compiler/testData/codegen/box/innerNested/kt5363.kt index 633af59bbc6..1f696893d3d 100644 --- a/compiler/testData/codegen/box/innerNested/kt5363.kt +++ b/compiler/testData/codegen/box/innerNested/kt5363.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Outer { class Nested{ fun foo(s: String) = s.extension() diff --git a/compiler/testData/codegen/box/properties/kt613.kt b/compiler/testData/codegen/box/properties/kt613.kt index d3075a89f2e..4f55c044844 100644 --- a/compiler/testData/codegen/box/properties/kt613.kt +++ b/compiler/testData/codegen/box/properties/kt613.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR package name class Test() { diff --git a/compiler/testData/codegen/box/regressions/kt6153.kt b/compiler/testData/codegen/box/regressions/kt6153.kt index 9374af34257..d2b703a5520 100644 --- a/compiler/testData/codegen/box/regressions/kt6153.kt +++ b/compiler/testData/codegen/box/regressions/kt6153.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // KT-6153 java.lang.IllegalStateException while building object Bug { diff --git a/compiler/testData/codegen/box/smartCasts/implicitMemberReceiver.kt b/compiler/testData/codegen/box/smartCasts/implicitMemberReceiver.kt index d83ae9faac1..f38fa9fd9b5 100644 --- a/compiler/testData/codegen/box/smartCasts/implicitMemberReceiver.kt +++ b/compiler/testData/codegen/box/smartCasts/implicitMemberReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class A { open val a = "OK" } diff --git a/compiler/testData/codegen/box/smartCasts/kt17725.kt b/compiler/testData/codegen/box/smartCasts/kt17725.kt index 91a593e873b..71334c4f85b 100644 --- a/compiler/testData/codegen/box/smartCasts/kt17725.kt +++ b/compiler/testData/codegen/box/smartCasts/kt17725.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Bob { fun Bob.bar() = "OK" } diff --git a/compiler/testData/codegen/box/traits/traitWithPrivateExtension.kt b/compiler/testData/codegen/box/traits/traitWithPrivateExtension.kt index 9f93bd724be..5dee33c0792 100644 --- a/compiler/testData/codegen/box/traits/traitWithPrivateExtension.kt +++ b/compiler/testData/codegen/box/traits/traitWithPrivateExtension.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class B { val p = "OK" } diff --git a/compiler/testData/ir/irText/expressions/destructuring1.fir.txt b/compiler/testData/ir/irText/expressions/destructuring1.fir.txt index e528d4d2978..daf90d02030 100644 --- a/compiler/testData/ir/irText/expressions/destructuring1.fir.txt +++ b/compiler/testData/ir/irText/expressions/destructuring1.fir.txt @@ -57,6 +57,8 @@ FILE fqName: fileName:/destructuring1.kt VAR name:x type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int [operator] declared in .B' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null + $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null VAR name:y type:kotlin.Int [val] CALL 'public final fun component2 (): kotlin.Int [operator] declared in .B' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null + $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.fir.txt b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.fir.txt index d159176e8a0..5606e1b25d3 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.fir.txt @@ -34,3 +34,4 @@ FILE fqName: fileName:/nullabilityAssertionOnExtensionReceiver.kt BLOCK_BODY CALL 'public final fun memberExtension (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null $this: GET_VAR ': .C declared in .testMemberExt' type=.C origin=null + $receiver: CALL 'public open fun s (): kotlin.String? declared in .J' type=kotlin.String? origin=null