diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt index ae77cb639be..291957cb2a4 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/scopes/JavaClassUseSiteMemberScope.kt @@ -43,6 +43,7 @@ class JavaClassUseSiteMemberScope( ) { private val typeParameterStack = klass.javaTypeParameterStack private val specialFunctions = hashMapOf>() + private val accessorByNameMap = hashMapOf() override fun getCallableNames(): Set { return declaredMemberScope.getContainingCallableNamesIfPresent() + superTypesScope.getCallableNames() @@ -57,16 +58,18 @@ class JavaClassUseSiteMemberScope( setterSymbol: FirNamedFunctionSymbol?, syntheticPropertyName: Name, ): FirAccessorSymbol { - return buildSyntheticProperty { - session = this@JavaClassUseSiteMemberScope.session - name = syntheticPropertyName - symbol = FirAccessorSymbol( - accessorId = getterSymbol.callableId, - callableId = CallableId(getterSymbol.callableId.packageName, getterSymbol.callableId.className, syntheticPropertyName) - ) - delegateGetter = getterSymbol.fir - delegateSetter = setterSymbol?.fir - }.symbol + return accessorByNameMap.getOrPut(syntheticPropertyName) { + buildSyntheticProperty { + session = this@JavaClassUseSiteMemberScope.session + name = syntheticPropertyName + symbol = FirAccessorSymbol( + accessorId = getterSymbol.callableId, + callableId = CallableId(getterSymbol.callableId.packageName, getterSymbol.callableId.className, syntheticPropertyName) + ) + delegateGetter = getterSymbol.fir + delegateSetter = setterSymbol?.fir + }.symbol + } } override fun processPropertiesByName(name: Name, processor: (FirVariableSymbol<*>) -> Unit) { diff --git a/compiler/testData/codegen/box/bridges/kt2498.kt b/compiler/testData/codegen/box/bridges/kt2498.kt index 56b2501dd6a..9b91ed788f4 100644 --- a/compiler/testData/codegen/box/bridges/kt2498.kt +++ b/compiler/testData/codegen/box/bridges/kt2498.kt @@ -1,6 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTIONS -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/box/collections/inheritFromHashtable.kt b/compiler/testData/codegen/box/collections/inheritFromHashtable.kt index 1880b44d06f..ae42962f28c 100644 --- a/compiler/testData/codegen/box/collections/inheritFromHashtable.kt +++ b/compiler/testData/codegen/box/collections/inheritFromHashtable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FULL_JDK diff --git a/compiler/testData/codegen/box/collections/kt41123.kt b/compiler/testData/codegen/box/collections/kt41123.kt index c4e0a6921c1..e112466aad0 100644 --- a/compiler/testData/codegen/box/collections/kt41123.kt +++ b/compiler/testData/codegen/box/collections/kt41123.kt @@ -2,7 +2,6 @@ // WASM_MUTE_REASON: STDLIB_COLLECTIONS // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME -// IGNORE_BACKEND_FIR: JVM_IR open class A : HashMap() diff --git a/compiler/testData/codegen/box/properties/collectionSize.kt b/compiler/testData/codegen/box/properties/collectionSize.kt index cb9973f797a..da1202b425d 100644 --- a/compiler/testData/codegen/box/properties/collectionSize.kt +++ b/compiler/testData/codegen/box/properties/collectionSize.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: Test.java diff --git a/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt b/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt index 5437eb7b6b0..194011d8c1d 100644 --- a/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt +++ b/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt @@ -1,6 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTIONS -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt b/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt index 435cbae40c9..e0e9eed3ee7 100644 --- a/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt +++ b/compiler/testData/codegen/box/specialBuiltins/entrySetSOE.kt @@ -1,6 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTIONS -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt b/compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt index 0000f80a425..dda5e3f62cb 100644 --- a/compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt +++ b/compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR abstract class A1 : Collection { override val size: Int get() = 1 }