diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDeclarations.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDeclarations.kt index c7f69b754e4..4db51b21b13 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDeclarations.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDeclarations.kt @@ -24,7 +24,8 @@ import org.jetbrains.kotlin.ir.util.DeepCopySymbolsRemapper import org.jetbrains.kotlin.ir.util.DescriptorsRemapper import org.jetbrains.kotlin.ir.visitors.acceptVoid -fun IrElement.deepCopyWithVariablesImpl(): IrElement { +@Suppress("UNCHECKED_CAST") +fun T.deepCopyWithVariables(): T { val descriptorsRemapper = object : DescriptorsRemapper { override fun remapDeclaredVariable(descriptor: VariableDescriptor) = LocalVariableDescriptor( /* containingDeclaration = */ descriptor.containingDeclaration, @@ -47,8 +48,5 @@ fun IrElement.deepCopyWithVariablesImpl(): IrElement { } }, null - ) -} - -inline fun T.deepCopyWithVariables(): T = - this.deepCopyWithVariablesImpl() as T \ No newline at end of file + ) as T +} \ No newline at end of file