From d6e74b9620e58b06c52d9e8a4747558595dd9642 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Thu, 21 Jan 2021 20:11:29 +0300 Subject: [PATCH] [JS IR] Use local scope for SAM if there are scopes [JS IR] Use private for top level sam wrappers and local otherwise ^KT-44433 fixed --- .../backend/js/lower/JsSingleAbstractMethodLowering.kt | 9 ++++----- .../box/coroutines/featureIntersection/funInterface.kt | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt index 0fc71862551..5ebede73f40 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsSingleAbstractMethodLowering.kt @@ -6,15 +6,15 @@ package org.jetbrains.kotlin.ir.backend.js.lower import org.jetbrains.kotlin.backend.common.BodyLoweringPass -import org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering import org.jetbrains.kotlin.backend.common.ScopeWithIr +import org.jetbrains.kotlin.backend.common.lower.SingleAbstractMethodLowering import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.DescriptorVisibility import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrBody -import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.expressions.IrTypeOperatorCall +import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.classOrNull import org.jetbrains.kotlin.ir.types.defaultType @@ -24,9 +24,8 @@ import org.jetbrains.kotlin.ir.util.render class JsSingleAbstractMethodLowering(context: JsIrBackendContext) : SingleAbstractMethodLowering(context), BodyLoweringPass { - override fun getWrapperVisibility(expression: IrTypeOperatorCall, scopes: List): DescriptorVisibility { - return DescriptorVisibilities.PRIVATE - } + override fun getWrapperVisibility(expression: IrTypeOperatorCall, scopes: List): DescriptorVisibility = + DescriptorVisibilities.LOCAL override val IrType.needEqualsHashCodeMethods get() = false diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface.kt index 7941bd85f23..6ae96488cce 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface.kt @@ -1,6 +1,6 @@ // WITH_RUNTIME // WITH_COROUTINES -// IGNORE_BACKEND: JVM, JS_IR +// IGNORE_BACKEND: JVM // IGNORE_LIGHT_ANALYSIS // LANGUAGE: +SuspendFunctionsInFunInterfaces, +JvmIrEnabledByDefault