File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
backend.common/src/org/jetbrains/kotlin/backend/common/lower
backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.runIf
5151 * println(x.element)
5252 * }
5353 */
54- class SharedVariablesLowering (val context : LoweringContext ) : BodyLoweringPass {
54+ open class SharedVariablesLowering (val context : LoweringContext , val skipRichCallables : Boolean = true ) : BodyLoweringPass {
5555 override fun lower (irBody : IrBody , container : IrDeclaration ) {
5656 SharedVariablesTransformer (irBody, container).lowerSharedVariables()
5757 }
@@ -87,8 +87,8 @@ class SharedVariablesLowering(val context: LoweringContext) : BodyLoweringPass {
8787 val toSkip = runIf(param.isInlineParameter() && ! param.isCrossinline) {
8888 when (arg) {
8989 is IrFunctionExpression -> arg.function
90- is IrRichFunctionReference -> arg.invokeFunction
91- is IrRichPropertyReference -> arg.getterFunction
90+ is IrRichFunctionReference if skipRichCallables -> arg.invokeFunction
91+ is IrRichPropertyReference if skipRichCallables -> arg.getterFunction
9292 else -> null
9393 }
9494 }
Original file line number Diff line number Diff line change @@ -74,9 +74,9 @@ private val jvmFilePhases = createFilePhases(
7474 ::AssertionLowering ,
7575 ::JvmReturnableBlockLowering ,
7676 ::SingletonReferencesLowering ,
77- ::SharedVariablesLowering ,
78-
7977 ::JvmUpgradeCallableReferences ,
78+ ::JvmSharedVariablesLowering ,
79+
8080 ::JvmInventNamesForLocalFunctions ,
8181 ::JvmLocalDeclarationsLowering ,
8282 ::JvmLocalDeclarationPopupLowering ,
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
4+ */
5+
6+ package org.jetbrains.kotlin.backend.jvm.lower
7+
8+ import org.jetbrains.kotlin.backend.common.lower.SharedVariablesLowering
9+ import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
10+
11+ class JvmSharedVariablesLowering (context : JvmBackendContext ) : SharedVariablesLowering(context, skipRichCallables = false )
You can’t perform that action at this time.
0 commit comments