From 26fae9e83a8369b3ba1bb8056eddad2f22990160 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Thu, 15 Feb 2024 18:00:48 +0100 Subject: [PATCH] [FIR] Allow declarations to override parts of non-trivial intersection A class can inherit two declarations that are compatible from the overridability standpoint and are therefore combined to a non-trivial intersection. At the same time, the class can declare a member declaration that only overrides one of the intersection's members. In this case, we break up the intersection and only add the overridden parts to the declared member's direct overridden list. If the class doesn't override the intersection, it exists as intersection override, like before. #KT-65487 Fixed --- ...CompilerTestFE10TestdataTestGenerated.java | 6 + ...LFirBlackBoxCodegenBasedTestGenerated.java | 12 + ...sticCompilerFE10TestDataTestGenerated.java | 6 + ...rsedBlackBoxCodegenBasedTestGenerated.java | 12 + .../problems/immutableName.overrides.txt | 8 +- ...eeOldFrontendDiagnosticsTestGenerated.java | 6 + ...siOldFrontendDiagnosticsTestGenerated.java | 6 + ...LightTreeBlackBoxCodegenTestGenerated.java | 12 + ...hIrFakeOverrideGeneratorTestGenerated.java | 12 + .../FirPsiBlackBoxCodegenTestGenerated.java | 12 + .../FirLightTreeJvmIrTextTestGenerated.java | 6 + .../ir/FirPsiJvmIrTextTestGenerated.java | 6 + .../scopes/JavaClassUseSiteMemberScope.kt | 15 ++ .../impl/AbstractFirUseSiteMemberScope.kt | 106 ++++++-- .../scopes/impl/FirClassUseSiteMemberScope.kt | 19 +- .../codegen/box/javaInterop/immutableName.kt | 50 ++++ .../intersectionWithMappedSignature.kt | 86 +++++++ .../intersectionWithMappedSignature.fir.kt | 38 +++ ...ctionWithMappedSignature.fir.overrides.txt | 25 ++ .../intersectionWithMappedSignature.kt | 38 +++ ...intersectionWithMappedSignature.fir.ir.txt | 194 ++++++++++++++ ...intersectionWithMappedSignature.fir.kt.txt | 8 + ...rsectionWithMappedSignature.fir.sig.kt.txt | 238 ++++++++++++++++++ .../intersectionWithMappedSignature.ir.txt | 197 +++++++++++++++ .../intersectionWithMappedSignature.kt | 13 + .../intersectionWithMappedSignature.kt.txt | 8 + ...intersectionWithMappedSignature.sig.kt.txt | 238 ++++++++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 + .../JvmAbiConsistencyTestBoxGenerated.java | 12 + .../codegen/BlackBoxCodegenTestGenerated.java | 6 + .../IrBlackBoxCodegenTestGenerated.java | 12 + ...kBoxCodegenWithIrInlinerTestGenerated.java | 12 + .../ir/ClassicJvmIrTextTestGenerated.java | 6 + .../LightAnalysisModeTestGenerated.java | 10 + 34 files changed, 1399 insertions(+), 42 deletions(-) create mode 100644 compiler/testData/codegen/box/javaInterop/immutableName.kt create mode 100644 compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt create mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.kt create mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.overrides.txt create mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.ir.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.sig.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.ir.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.sig.kt.txt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 303fc741f66..1896140588f 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -22721,6 +22721,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantCharAtAbstract.kt") public void testIrrelevantCharAtAbstract() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index b7259348020..7e4fb0f0fee 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -30950,6 +30950,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -52316,6 +52322,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 34a73a5a6e7..2cc278c438c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -22721,6 +22721,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantCharAtAbstract.kt") public void testIrrelevantCharAtAbstract() { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index 825b1e63364..21db1c6efac 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -30950,6 +30950,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -52316,6 +52322,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt index c8ab188889c..15c7b4aed59 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/immutableName.overrides.txt @@ -1,14 +1,12 @@ ImplDerived: [Source]: public abstract override fun foo(name: R|kotlin/String?|): R|Derived| from Use site scope of /ImplDerived [id: 0] - [Source]: public open override fun foo(name: R|kotlin/String|): R|Base| from Use site scope of /Impl [id: 1] - [Enhancement]: public abstract fun foo(name: R|@EnhancedNullability kotlin/String|): R|Base!| from Java enhancement scope for /Base [id: 2] - [Enhancement]: public abstract fun foo(name: R|kotlin/String!|): R|@EnhancedNullability Derived| from Java enhancement scope for /Derived [id: 3] + [Enhancement]: public abstract fun foo(name: R|kotlin/String!|): R|@EnhancedNullability Derived| from Java enhancement scope for /Derived [id: 1] [Enhancement]: public abstract fun foo(name: R|@EnhancedNullability kotlin/String|): R|Base!| from Java enhancement scope for /Base [id: 2] + [Source]: public open override fun foo(name: R|kotlin/String|): R|Base| from Use site scope of /ImplDerived [id: 0] DerivedImpl: [Source]: public abstract override fun foo(name: R|kotlin/String?|): R|Derived| from Use site scope of /DerivedImpl [id: 0] [Enhancement]: public abstract fun foo(name: R|kotlin/String!|): R|@EnhancedNullability Derived| from Java enhancement scope for /Derived [id: 1] [Enhancement]: public abstract fun foo(name: R|@EnhancedNullability kotlin/String|): R|Base!| from Java enhancement scope for /Base [id: 2] - [Source]: public open override fun foo(name: R|kotlin/String|): R|Base| from Use site scope of /Impl [id: 3] - [Enhancement]: public abstract fun foo(name: R|@EnhancedNullability kotlin/String|): R|Base!| from Java enhancement scope for /Base [id: 2] + [Source]: public open override fun foo(name: R|kotlin/String|): R|Base| from Use site scope of /DerivedImpl [id: 0] diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index b0fcc806c39..2d558a113f3 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -22715,6 +22715,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantCharAtAbstract.kt") public void testIrrelevantCharAtAbstract() { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index b2114d81f9d..0d228af53e1 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -22721,6 +22721,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantCharAtAbstract.kt") public void testIrrelevantCharAtAbstract() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 8d2e039c144..baccaef4f82 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -30819,6 +30819,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -51999,6 +52005,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index b48242508e0..a05c1389596 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -30819,6 +30819,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -51999,6 +52005,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index fa9c6b3ce33..c87c2bbb995 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -30819,6 +30819,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -52051,6 +52057,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index ab7c16c434c..726d78318bb 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -2703,6 +2703,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI public void testFakeOverrideOfRawJavaCollection() { runTest("compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.kt"); } + + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt"); + } } @Nested diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index 8cc8b75f2ac..a517be3c6dc 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -2703,6 +2703,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { public void testFakeOverrideOfRawJavaCollection() { runTest("compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.kt"); } + + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt"); + } } @Nested 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 bb5ebb70ec7..5a540d7ff08 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 @@ -32,6 +32,7 @@ import org.jetbrains.kotlin.fir.scopes.* import org.jetbrains.kotlin.fir.scopes.impl.AbstractFirUseSiteMemberScope import org.jetbrains.kotlin.fir.scopes.impl.FirTypeIntersectionScopeContext.ResultOfIntersection import org.jetbrains.kotlin.fir.scopes.impl.MembersByScope +import org.jetbrains.kotlin.fir.scopes.impl.isIntersectionOverride import org.jetbrains.kotlin.fir.scopes.impl.similarFunctionsOrBothProperties import org.jetbrains.kotlin.fir.scopes.jvm.computeJvmDescriptor import org.jetbrains.kotlin.fir.symbols.impl.* @@ -400,6 +401,20 @@ class JavaClassUseSiteMemberScope( return result.toSet() } + private fun > ResultOfIntersection.extractSomeSymbolFromSuperType(): D { + return if (this.isIntersectionOverride()) { + /* + * we don't want to create intersection override if some declared function actually overrides some functions + * from supertypes, so instead of intersection override symbol we check actual symbol from supertype + * + * TODO(KT-65925): is it enough to check only one function? + */ + keySymbol + } else { + chosenSymbol + } + } + private fun processSpecialFunctions( requestedName: Name, explicitlyDeclaredFunctionsWithNaturalName: Collection, diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt index b7bcc4043cf..74014324c0c 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/AbstractFirUseSiteMemberScope.kt @@ -86,17 +86,59 @@ abstract class AbstractFirUseSiteMemberScope( protected abstract fun FirNamedFunctionSymbol.isVisibleInCurrentClass(): Boolean + private fun FirCallableSymbol<*>.isInvisible(): Boolean { + return this is FirNamedFunctionSymbol && !isVisibleInCurrentClass() + } + protected fun collectFunctionsFromSupertypes( name: Name, destination: MutableList, explicitlyDeclaredFunctions: Set ) { - for (chosenSymbolFromSupertype in getFunctionsFromSupertypesByName(name)) { - val superSymbol = chosenSymbolFromSupertype.extractSomeSymbolFromSuperType() - if (!superSymbol.isVisibleInCurrentClass()) continue - val overriddenBy = superSymbol.getOverridden(explicitlyDeclaredFunctions) - if (overriddenBy == null) { - destination += chosenSymbolFromSupertype.chosenSymbol + for (resultOfIntersection in getFunctionsFromSupertypesByName(name)) { + resultOfIntersection.collectNonOverriddenDeclarations(explicitlyDeclaredFunctions, destination) + } + } + + /** + * If the receiver [ResultOfIntersection] is not overridden by any symbol in [explicitlyDeclared], + * adds its [ResultOfIntersection.chosenSymbol] to [destination]. + * + * If the [ResultOfIntersection] is [ResultOfIntersection.NonTrivial] and only some of the intersected symbols are overridden, + * constructs a new [ResultOfIntersection] consisting of the non-overridden symbols and adds its [ResultOfIntersection.chosenSymbol] + * to [destination]. + * + * It's the opposite operation of [collectDirectOverriddenForDeclared]. + */ + protected fun > ResultOfIntersection.collectNonOverriddenDeclarations( + explicitlyDeclared: Set>, + destination: MutableList, + ) { + when (this) { + is ResultOfIntersection.SingleMember -> { + val chosenSymbol = chosenSymbol + if (chosenSymbol.isInvisible()) return + val overriddenBy = chosenSymbol.getOverridden(explicitlyDeclared) + if (overriddenBy == null) { + destination += chosenSymbol + } + } + is ResultOfIntersection.NonTrivial -> { + // For non-trivial intersections, some of the intersected symbols can be overridden and some not. + val (visibleNotOverridden, overriddenOrInvisible) = overriddenMembers + .partition { !it.member.isInvisible() && it.member.getOverridden(explicitlyDeclared) == null } + + if (overriddenOrInvisible.isEmpty()) { + // Case 1: all intersected symbols are overridden. + destination += chosenSymbol + } else if (visibleNotOverridden.isNotEmpty()) { + // Case 2: some intersected symbols are overridden. + // Create a new ResultOfIntersection from the non-overridden and add it to destination. + destination += supertypeScopeContext + .convertGroupedCallablesToIntersectionResults(visibleNotOverridden.map { it.baseScope to listOf(it.member) }) + .map { it.chosenSymbol } + } + // Case 3: all are overridden. Don't add anything to destination. } } } @@ -121,27 +163,47 @@ abstract class AbstractFirUseSiteMemberScope( private fun computeDirectOverriddenForDeclaredFunction(declaredFunctionSymbol: FirNamedFunctionSymbol): List> { val result = mutableListOf>() - val declaredFunction = declaredFunctionSymbol.fir for (resultOfIntersection in getFunctionsFromSupertypesByName(declaredFunctionSymbol.name)) { - val symbolFromSupertype = resultOfIntersection.extractSomeSymbolFromSuperType() - if (overrideChecker.isOverriddenFunction(declaredFunction, symbolFromSupertype.fir)) { - result.add(resultOfIntersection) - } + resultOfIntersection.collectDirectOverriddenForDeclared(declaredFunctionSymbol, result, overrideChecker::isOverriddenFunction) } return result } - protected fun > ResultOfIntersection.extractSomeSymbolFromSuperType(): D { - return if (this.isIntersectionOverride()) { - /* - * we don't want to create intersection override if some declared function actually overrides some functions - * from supertypes, so instead of intersection override symbol we check actual symbol from supertype - * - * TODO: is it enough to check only one function? - */ - keySymbol - } else { - chosenSymbol + /** + * If [declared] overrides the receiver [ResultOfIntersection], adds it to [result]. + * If the [ResultOfIntersection] is [ResultOfIntersection.NonTrivial] and [declared] only overrides some of the intersected symbols, + * a new [ResultOfIntersection] is constructed containing only the overridden symbols. + * + * Opposite operation to [collectNonOverriddenDeclarations]. + */ + protected inline fun > ResultOfIntersection.collectDirectOverriddenForDeclared( + declared: T, + result: MutableList>, + isOverridden: (T, T) -> Boolean, + ) { + when (this) { + is ResultOfIntersection.SingleMember -> { + val symbolFromSupertype = chosenSymbol + if (isOverridden(declared, symbolFromSupertype)) { + result.add(this) + } + } + is ResultOfIntersection.NonTrivial -> { + // For non-trivial intersections, declared can override a subset of the intersected symbols. + val (overridden, nonOverridden) = overriddenMembers.partition { + isOverridden(declared, it.member) + } + + if (nonOverridden.isEmpty()) { + // Case 1: all intersected symbols are overridden + result += this + } else if (overridden.isNotEmpty()) { + // Case 2: some intersected symbols are overridden. + // Create a new ResultOfIntersection from the overridden symbols and add it to result. + result += supertypeScopeContext.convertGroupedCallablesToIntersectionResults(overridden.map { it.baseScope to listOf(it.member) }) + } + // Case 3: No intersected symbols are overridden. Don't add anything to result. + } } } diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassUseSiteMemberScope.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassUseSiteMemberScope.kt index 1292d9e4b42..64b7ee51dba 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassUseSiteMemberScope.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassUseSiteMemberScope.kt @@ -9,10 +9,7 @@ import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.FirClass import org.jetbrains.kotlin.fir.declarations.utils.isStatic import org.jetbrains.kotlin.fir.resolve.defaultType -import org.jetbrains.kotlin.fir.scopes.FirContainingNamesAwareScope -import org.jetbrains.kotlin.fir.scopes.FirIntersectionScopeOverrideChecker -import org.jetbrains.kotlin.fir.scopes.FirTypeScope -import org.jetbrains.kotlin.fir.scopes.firOverrideChecker +import org.jetbrains.kotlin.fir.scopes.* import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.name.Name @@ -49,12 +46,8 @@ class FirClassUseSiteMemberScope( val (properties, fields) = getPropertiesAndFieldsFromSupertypesByName(name) - for (propertyFromSupertype in properties) { - val superSymbol = propertyFromSupertype.extractSomeSymbolFromSuperType() - val overriddenBy = superSymbol.getOverridden(explicitlyDeclaredProperties) - if (overriddenBy == null) { - add(propertyFromSupertype.chosenSymbol) - } + for (resultOfIntersection in properties) { + resultOfIntersection.collectNonOverriddenDeclarations(explicitlyDeclaredProperties, this@buildList) } addAll(fields) } @@ -62,12 +55,8 @@ class FirClassUseSiteMemberScope( private fun computeDirectOverriddenForDeclaredProperty(declaredPropertySymbol: FirPropertySymbol): List> { val result = mutableListOf>() - val declaredProperty = declaredPropertySymbol.fir for (resultOfIntersection in getPropertiesAndFieldsFromSupertypesByName(declaredPropertySymbol.name).first) { - val symbolFromSupertype = resultOfIntersection.extractSomeSymbolFromSuperType() - if (overrideChecker.isOverriddenProperty(declaredProperty, symbolFromSupertype.fir)) { - result.add(resultOfIntersection) - } + resultOfIntersection.collectDirectOverriddenForDeclared(declaredPropertySymbol, result, overrideChecker::isOverriddenProperty) } return result } diff --git a/compiler/testData/codegen/box/javaInterop/immutableName.kt b/compiler/testData/codegen/box/javaInterop/immutableName.kt new file mode 100644 index 00000000000..b2448c8b087 --- /dev/null +++ b/compiler/testData/codegen/box/javaInterop/immutableName.kt @@ -0,0 +1,50 @@ +// TARGET_BACKEND: JVM +// FILE: Base.java +import org.jetbrains.annotations.NotNull; + +public interface Base { + Base foo(@NotNull String name); +} + +// FILE: Derived.java +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface Derived extends Base { + @Override + @NotNull Derived foo(@Nullable String name); +} + +// FILE: Impl.kt +abstract class Impl : Base { + override fun foo(name: String): Base = this +} + +// FILE: test.kt +abstract class ImplDerived : Impl(), Derived { + abstract override fun foo(name: String?): Derived +} + +abstract class DerivedImpl : Derived, Impl() { + abstract override fun foo(name: String?): Derived +} + +fun box(): String { + val x1: ImplDerived = object : ImplDerived() { + override fun foo(name: String?): Derived = this + } + x1.foo("") + (x1 as Base).foo("") + (x1 as Derived).foo("") + (x1 as Impl).foo("") + + val x2: DerivedImpl = object : DerivedImpl() { + override fun foo(name: String?): Derived = this + } + x2.foo("") + (x2 as Base).foo("") + (x2 as Derived).foo("") + (x2 as Impl).foo("") + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt b/compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt new file mode 100644 index 00000000000..37fb559b7f5 --- /dev/null +++ b/compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt @@ -0,0 +1,86 @@ +// TARGET_BACKEND: JVM_IR +// ^Old backend reports CONFLICTING_JVM_DECLARATIONS on C1, K1 with IR is fine. +// FULL_JDK +// FILE: Remove.java +public interface Remove { + Boolean remove(Integer element); +} + +// FILE: GetBoxed.java +public interface GetBoxed { + Character get(Integer i); +} + +// FILE: GetPrimitive.java +public interface GetPrimitive { + Character get(int i); +} + +// FILE: MyString.java +public abstract class MyString implements CharSequence { + @Override public char charAt(int i) { return 'j'; } + + @Override public int length() { return 0; } + @Override public CharSequence subSequence(int start, int end) { return null; } +} + +// FILE: box.kt +class RemoveOverridden : ArrayList(), Remove { + // Overrides Remove.remove but not ArrayList.remove + override fun remove(element: Int?): Boolean = false +} + +class RemoveNotOverridden : ArrayList(), Remove { +} + +class GetBoxedOverridden : MyString(), GetBoxed { + // Overrides GetBoxed.get but not MyString.charAt + override fun get(i: Int?): Char? = 'k' +} + +class GetPrimitiveOverridden : MyString(), GetPrimitive { + // Overrides GetPrimitive.get and MyString.charAt + override fun get(i: Int): Char = 'k' +} + +fun box(): String { + val r1 = RemoveOverridden() + r1.add(1) + r1.add(2) + + r1.remove(1 as Int?) + (r1 as Remove).remove(1) + if (1 !in r1) return "FAIL 1" + + r1.remove(1) + if (1 in r1) return "FAIL 2" + + (r1 as ArrayList).remove(2) + if (2 in r1) return "FAIL 3" + + val r2 = RemoveNotOverridden() + r2.add(1) + r2.add(2) + r2.add(3) + + (r2 as Remove).remove(1) + if (1 in r2) return "FAIL 4" + + r2.remove(2) + if (1 in r2) return "FAIL 5" + + (r2 as ArrayList).remove(3) + if (2 in r2) return "FAIL 6" + + val g1 = GetBoxedOverridden() + if (g1.get(1) != 'j') return "FAIL 7" + if ((g1 as MyString).get(1) != 'j') return "FAIL 8" + if ((g1 as GetBoxed).get(1) != 'k') return "FAIL 9" + + val g2 = GetPrimitiveOverridden() + if (g2.get(1) != 'k') return "FAIL 10" + if ((g2 as MyString).get(1) != 'k') return "FAIL 11" + if ((g2 as GetPrimitive).get(1) != 'k') return "FAIL 12" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.kt new file mode 100644 index 00000000000..89d92746df4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.kt @@ -0,0 +1,38 @@ +// FULL_JDK +// SCOPE_DUMP: B1:remove, B2:remove +// FILE: Java1.java +public interface Java1 { + Boolean remove(Integer element); +} + +// FILE: testRemove.kt +import java.util.* + +// CONFLICTING_JVM_DECLARATIONS in K1 is only reported with old backend, not with K1. +class B1 : ArrayList(), Java1 { + override fun remove(element: Int?): Boolean { + return false + } +} + +// CONFLICTING_JVM_DECLARATIONS in K1 is only reported with old backend, not with K1. +class B2 : ArrayList(), Java1 { +} + +// FILE: Java2.java +public interface Java2 { + Character get(Integer i); +} + +// FILE: MyString.java +public abstract class MyString implements CharSequence { + @Override + public char charAt(int i) { + return 'c'; + } +} + +// FILE: testRenamed.kt +abstract class B3 : MyString(), Java2 { + override fun get(i: Int?): Char? = null +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.overrides.txt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.overrides.txt new file mode 100644 index 00000000000..6249bd308c6 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.fir.overrides.txt @@ -0,0 +1,25 @@ +B1: + [Source]: public open override fun remove(element: R|kotlin/Int?|): R|kotlin/Boolean| from Use site scope of /B1 [id: 0] + [Enhancement]: public abstract fun remove(element: R|kotlin/Int!|): R|kotlin/Boolean!| from Java enhancement scope for /Java1 [id: 1] + [SubstitutionOverride(DeclarationSite)]: public open override fun remove(p0: R|@EnhancedNullability kotlin/Int|): R|kotlin/Boolean| from Use site scope of /B1 [id: 0] + +B2: + [IntersectionOverride]: public open override fun remove(p0: R|@EnhancedNullability kotlin/Int|): R|kotlin/Boolean| from Use site scope of /B2 [id: 0] + [SubstitutionOverride(DeclarationSite)]: public open override fun remove(p0: R|@EnhancedNullability kotlin/Int|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for java/util/ArrayList] for type B2 [id: 1] + [Enhancement]: public open fun remove(p0: R|@EnhancedNullability E|): R|kotlin/Boolean| from Java enhancement scope for java/util/ArrayList [id: 2] + [SubstitutionOverride(DeclarationSite)]: public open override fun remove(p0: R|ft|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for java/util/AbstractList] for type java/util/ArrayList [id: 3] + [IntersectionOverride]: public open override fun remove(p0: R|ft|): R|kotlin/Boolean| from Java enhancement scope for java/util/AbstractList [id: 4] + [SubstitutionOverride(DeclarationSite)]: public open override fun remove(p0: R|ft|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for java/util/AbstractCollection] for type java/util/AbstractList [id: 5] + [Enhancement]: public open fun remove(p0: R|ft|): R|kotlin/Boolean| from Java enhancement scope for java/util/AbstractCollection [id: 6] + [SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(element: R|ft|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableCollection] for type java/util/AbstractCollection [id: 7] + [Library]: public abstract fun remove(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableCollection [id: 8] + [SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(element: R|ft|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableList] for type java/util/AbstractList [id: 9] + [Library]: public abstract fun remove(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableList [id: 10] + [SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(element: R|E|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableCollection] for type kotlin/collections/MutableList [id: 11] + [Library]: public abstract fun remove(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableCollection [id: 8] + [SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(element: R|E|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableList] for type java/util/ArrayList [id: 12] + [Library]: public abstract fun remove(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableList [id: 10] + [SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(element: R|E|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableCollection] for type kotlin/collections/MutableList [id: 11] + [Library]: public abstract fun remove(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableCollection [id: 8] + [Enhancement]: public abstract fun remove(element: R|kotlin/Int!|): R|kotlin/Boolean!| from Java enhancement scope for /Java1 [id: 13] + diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt new file mode 100644 index 00000000000..5a8fea977a8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt @@ -0,0 +1,38 @@ +// FULL_JDK +// SCOPE_DUMP: B1:remove, B2:remove +// FILE: Java1.java +public interface Java1 { + Boolean remove(Integer element); +} + +// FILE: testRemove.kt +import java.util.* + +// CONFLICTING_JVM_DECLARATIONS in K1 is only reported with old backend, not with K1. +class B1 : ArrayList(), Java1 { + override fun remove(element: Int?): Boolean { + return false + } +} + +// CONFLICTING_JVM_DECLARATIONS in K1 is only reported with old backend, not with K1. +class B2 : ArrayList(), Java1 { +} + +// FILE: Java2.java +public interface Java2 { + Character get(Integer i); +} + +// FILE: MyString.java +public abstract class MyString implements CharSequence { + @Override + public char charAt(int i) { + return 'c'; + } +} + +// FILE: testRenamed.kt +abstract class B3 : MyString(), Java2 { + override fun get(i: Int?): Char? = null +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.ir.txt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.ir.txt new file mode 100644 index 00000000000..7c8602be7d3 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.ir.txt @@ -0,0 +1,194 @@ +FILE fqName: fileName:/1.kt + CLASS CLASS name:B modality:ABSTRACT visibility:public superTypes:[java.util.ArrayList; .Java1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' + : kotlin.Int + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:ABSTRACT visibility:public superTypes:[java.util.ArrayList; .Java1]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (p0: kotlin.Int, p1: @[EnhancedNullability] kotlin.collections.Collection): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.collections.Collection + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>, p0:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (p0: kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> + VALUE_PARAMETER name:p0 index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun get (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + public open fun hashCode (): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun listIterator (p0: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.Int?> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (p0: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + public abstract fun remove (element: @[FlexibleNullability] kotlin.Int?): @[FlexibleNullability] kotlin.Boolean? declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (p0: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:@[EnhancedNullability] kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun set (p0: kotlin.Int, p1: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.Int?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection) returnType:@[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] kotlin.Int?> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun subList (p0: kotlin.Int, p1: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? [fake_override] + overridden: + public open fun toArray (): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.B.toArray?>?) returnType:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.B.toArray?>? [fake_override] + overridden: + public open fun toArray (p0: @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array?): @[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array? declared in java.util.ArrayList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] @[FlexibleArrayElementVariance] kotlin.Array.B.toArray?>? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + public open fun toString (): kotlin.String declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.kt.txt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.kt.txt new file mode 100644 index 00000000000..ca6f0a0f427 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.kt.txt @@ -0,0 +1,8 @@ +abstract class B : ArrayList, Java1 { + constructor() /* primary */ { + super/*ArrayList*/() + /* () */ + + } + +} diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.sig.kt.txt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.sig.kt.txt new file mode 100644 index 00000000000..bea8b7fbad5 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.fir.sig.kt.txt @@ -0,0 +1,238 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +abstract class B : ArrayList, Java1 { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#add(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.add|7559962077055454748[0] + // Public signature debug description: add(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun add(p0: @EnhancedNullability Int): Boolean + + // CHECK: + // Mangled name: B#add(kotlin.Int;kotlin.Int{EnhancedNullability}){} + // Public signature: /B.add|-3194712170900556378[0] + // Public signature debug description: add(kotlin.Int;kotlin.Int{EnhancedNullability}){} + /* fake */ override fun add(p0: Int, p1: @EnhancedNullability Int): Unit + + // CHECK JVM_IR: + // Mangled name: B#addAll(kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.addAll|-8388196230555083661[0] + // Public signature debug description: addAll(kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun addAll(p0: @EnhancedNullability Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: B#addAll(kotlin.Int;kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.addAll|30670022050259765[0] + // Public signature debug description: addAll(kotlin.Int;kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun addAll(p0: Int, p1: @EnhancedNullability Collection): Boolean + + // CHECK: + // Mangled name: B#clear(){} + // Public signature: /B.clear|-6446868449915108923[0] + // Public signature debug description: clear(){} + /* fake */ override fun clear(): Unit + + // CHECK JVM_IR: + // Mangled name: B#clone(){}kotlin.Any{EnhancedNullability} + // Public signature: /B.clone|178802004086941196[0] + // Public signature debug description: clone(){}kotlin.Any{EnhancedNullability} + /* fake */ override fun clone(): @EnhancedNullability Any + + // CHECK JVM_IR: + // Mangled name: B#contains(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.contains|3736388240191289860[0] + // Public signature debug description: contains(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + /* fake */ override operator fun contains(p0: @EnhancedNullability Int): Boolean + + // CHECK JVM_IR: + // Mangled name: B#containsAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /B.containsAll|-6765067201579764726[0] + // Public signature debug description: containsAll(kotlin.collections.Collection){}kotlin.Boolean + /* fake */ override fun containsAll(p0: Collection<@EnhancedNullability Int>): Boolean + + // CHECK: + // Mangled name: B#ensureCapacity(kotlin.Int){} + // Public signature: /B.ensureCapacity|-7913402150632352615[0] + // Public signature debug description: ensureCapacity(kotlin.Int){} + /* fake */ override fun ensureCapacity(p0: Int): Unit + + // CHECK JVM_IR: + // Mangled name: B#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /B.equals|722809408929142791[0] + // Public signature debug description: equals(kotlin.Any?){}kotlin.Boolean + /* fake */ override operator fun equals(p0: Any?): Boolean + + // CHECK: + // Mangled name: B#forEach(java.util.function.Consumer?){} + // Public signature: /B.forEach|5766969768772302175[0] + // Public signature debug description: forEach(java.util.function.Consumer?){} + /* fake */ override fun forEach(p0: Consumer?): Unit + + // CHECK JVM_IR: + // Mangled name: B#get(kotlin.Int){}kotlin.Int{EnhancedNullability} + // Public signature: /B.get|-8822924217357855534[0] + // Public signature debug description: get(kotlin.Int){}kotlin.Int{EnhancedNullability} + /* fake */ override operator fun get(p0: Int): @EnhancedNullability Int + + // CHECK JVM_IR: + // Mangled name: B#hashCode(){}kotlin.Int + // Public signature: /B.hashCode|-8048879360829830756[0] + // Public signature debug description: hashCode(){}kotlin.Int + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: B#indexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + // Public signature: /B.indexOf|866974352596659798[0] + // Public signature debug description: indexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + /* fake */ override fun indexOf(p0: @EnhancedNullability Int): Int + + // CHECK JVM_IR: + // Mangled name: B#isEmpty(){}kotlin.Boolean + // Public signature: /B.isEmpty|-626562167393617703[0] + // Public signature debug description: isEmpty(){}kotlin.Boolean + /* fake */ override fun isEmpty(): Boolean + + // CHECK JVM_IR: + // Mangled name: B#iterator(){}kotlin.collections.MutableIterator{EnhancedNullability} + // Public signature: /B.iterator|115627760567581658[0] + // Public signature debug description: iterator(){}kotlin.collections.MutableIterator{EnhancedNullability} + /* fake */ override operator fun iterator(): @EnhancedNullability MutableIterator<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#lastIndexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + // Public signature: /B.lastIndexOf|1115527748420890033[0] + // Public signature debug description: lastIndexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + /* fake */ override fun lastIndexOf(p0: @EnhancedNullability Int): Int + + // CHECK JVM_IR: + // Mangled name: B#listIterator(){}kotlin.collections.MutableListIterator{EnhancedNullability} + // Public signature: /B.listIterator|4960815808465755041[0] + // Public signature debug description: listIterator(){}kotlin.collections.MutableListIterator{EnhancedNullability} + /* fake */ override fun listIterator(): @EnhancedNullability MutableListIterator<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#listIterator(kotlin.Int){}kotlin.collections.MutableListIterator{EnhancedNullability} + // Public signature: /B.listIterator|-2268028930611070307[0] + // Public signature debug description: listIterator(kotlin.Int){}kotlin.collections.MutableListIterator{EnhancedNullability} + /* fake */ override fun listIterator(p0: Int): @EnhancedNullability MutableListIterator<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#parallelStream(){}java.util.stream.Stream{EnhancedNullability} + // Public signature: /B.parallelStream|-4126444245712748289[0] + // Public signature debug description: parallelStream(){}java.util.stream.Stream{EnhancedNullability} + /* fake */ override fun parallelStream(): @EnhancedNullability Stream + + // CHECK JVM_IR: + // Mangled name: B#remove(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.remove|2933193249427016334[0] + // Public signature debug description: remove(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun remove(p0: @EnhancedNullability Int): Boolean + + // CHECK JVM_IR: + // Mangled name: B#removeAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /B.removeAll|-5493620261823900507[0] + // Public signature debug description: removeAll(kotlin.collections.Collection){}kotlin.Boolean + /* fake */ override fun removeAll(p0: Collection<@EnhancedNullability Int>): Boolean + + // CHECK JVM_IR: + // Mangled name: B#removeAt(kotlin.Int){}kotlin.Int{EnhancedNullability} + // Public signature: /B.removeAt|6480490686215931144[0] + // Public signature debug description: removeAt(kotlin.Int){}kotlin.Int{EnhancedNullability} + /* fake */ override operator fun removeAt(p0: Int): @EnhancedNullability Int + + // CHECK JVM_IR: + // Mangled name: B#removeIf(java.util.function.Predicate{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.removeIf|-1099538878717265414[0] + // Public signature debug description: removeIf(java.util.function.Predicate{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun removeIf(p0: @EnhancedNullability Predicate): Boolean + + // CHECK: + // Mangled name: B#removeRange(kotlin.Int;kotlin.Int){} + // Public signature: /B.removeRange|7632320944993890593[0] + // Public signature debug description: removeRange(kotlin.Int;kotlin.Int){} + protected_and_package /* fake */ override fun removeRange(p0: Int, p1: Int): Unit + + // CHECK: + // Mangled name: B#replaceAll(java.util.function.UnaryOperator{EnhancedNullability}){} + // Public signature: /B.replaceAll|6373979877176729001[0] + // Public signature debug description: replaceAll(java.util.function.UnaryOperator{EnhancedNullability}){} + /* fake */ override fun replaceAll(p0: @EnhancedNullability UnaryOperator<@EnhancedNullability Int>): Unit + + // CHECK JVM_IR: + // Mangled name: B#retainAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /B.retainAll|-3550913358824719637[0] + // Public signature debug description: retainAll(kotlin.collections.Collection){}kotlin.Boolean + /* fake */ override fun retainAll(p0: Collection<@EnhancedNullability Int>): Boolean + + // CHECK JVM_IR: + // Mangled name: B#set(kotlin.Int;kotlin.Int{EnhancedNullability}){}kotlin.Int{EnhancedNullability} + // Public signature: /B.set|-7932912415931410975[0] + // Public signature debug description: set(kotlin.Int;kotlin.Int{EnhancedNullability}){}kotlin.Int{EnhancedNullability} + /* fake */ override operator fun set(p0: Int, p1: @EnhancedNullability Int): @EnhancedNullability Int + + // CHECK: + // Mangled name: B#sort(java.util.Comparator?){} + // Public signature: /B.sort|8069876015820305517[0] + // Public signature debug description: sort(java.util.Comparator?){} + /* fake */ override fun sort(p0: Comparator?): Unit + + // CHECK JVM_IR: + // Mangled name: B#spliterator(){}java.util.Spliterator{EnhancedNullability} + // Public signature: /B.spliterator|-3709449862893660489[0] + // Public signature debug description: spliterator(){}java.util.Spliterator{EnhancedNullability} + /* fake */ override fun spliterator(): @EnhancedNullability Spliterator + + // CHECK JVM_IR: + // Mangled name: B#stream(){}java.util.stream.Stream{EnhancedNullability} + // Public signature: /B.stream|2853909100718896833[0] + // Public signature debug description: stream(){}java.util.stream.Stream{EnhancedNullability} + /* fake */ override fun stream(): @EnhancedNullability Stream + + // CHECK JVM_IR: + // Mangled name: B#subList(kotlin.Int;kotlin.Int){}kotlin.collections.MutableList{EnhancedNullability} + // Public signature: /B.subList|127837164145565172[0] + // Public signature debug description: subList(kotlin.Int;kotlin.Int){}kotlin.collections.MutableList{EnhancedNullability} + /* fake */ override fun subList(p0: Int, p1: Int): @EnhancedNullability MutableList<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#toArray(){}kotlin.Array? + // Public signature: /B.toArray|-8468800257910341540[0] + // Public signature debug description: toArray(){}kotlin.Array? + /* fake */ override fun toArray(): Array? + + // CHECK JVM_IR: + // Mangled name: B#toArray(kotlin.Array?){0§}kotlin.Array? + // Public signature: /B.toArray|-7248906015406159030[0] + // Public signature debug description: toArray(kotlin.Array?){0§}kotlin.Array? + /* fake */ override fun toArray(p0: Array?): Array? + + // CHECK JVM_IR: + // Mangled name: B#toString(){}kotlin.String{EnhancedNullability} + // Public signature: /B.toString|7581629773206850948[0] + // Public signature debug description: toString(){}kotlin.String{EnhancedNullability} + /* fake */ override fun toString(): @EnhancedNullability String + + // CHECK: + // Mangled name: B#trimToSize(){} + // Public signature: /B.trimToSize|-5937642362792008740[0] + // Public signature debug description: trimToSize(){} + /* fake */ override fun trimToSize(): Unit + + // CHECK: + // Mangled name: B{}size + // Public signature: /B.size|-6253659984320132064[0] + // Public signature debug description: {}size + /* fake */ override val size: Int + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Int + // Public signature: /B.size.|-3941649985161900780[0] + // Public signature debug description: (){}kotlin.Int + /* fake */ override get(): Int + +} diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.ir.txt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.ir.txt new file mode 100644 index 00000000000..78145533115 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.ir.txt @@ -0,0 +1,197 @@ +FILE fqName: fileName:/1.kt + CLASS CLASS name:B modality:ABSTRACT visibility:public superTypes:[java.util.ArrayList; .Java1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in java.util.ArrayList' + : @[FlexibleNullability] kotlin.Int? + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:ABSTRACT visibility:public superTypes:[java.util.ArrayList; .Java1]' + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun add (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:add visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun add (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:addAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, elements:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun addAll (index: kotlin.Int, elements: @[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:elements index:1 type:@[EnhancedNullability] kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:clear visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun clear (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:clone visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + overridden: + public open fun clone (): @[EnhancedNullability] kotlin.Any declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:contains visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun contains (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun containsAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:ensureCapacity visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun ensureCapacity (p0: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>, other:@[EnhancedNullability] kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: @[EnhancedNullability] kotlin.Any?): kotlin.Boolean declared in java.util.ArrayList + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> + VALUE_PARAMETER name:other index:0 type:@[EnhancedNullability] kotlin.Any? + FUN FAKE_OVERRIDE name:forEach visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.function.Consumer?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun forEach (p0: @[FlexibleNullability] java.util.function.Consumer?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.function.Consumer? + FUN FAKE_OVERRIDE name:get visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun get (index: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?>) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in java.util.ArrayList + public open fun hashCode (): kotlin.Int declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractList<@[FlexibleNullability] kotlin.Int?> + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public open fun indexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun isEmpty (): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:iterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] kotlin.Int> [fake_override,operator] + overridden: + public open fun iterator (): @[EnhancedNullability] kotlin.collections.MutableIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Int [fake_override] + overridden: + public open fun lastIndexOf (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun listIterator (): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun listIterator (index: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableListIterator<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:parallelStream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun parallelStream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.Int?> + FUN FAKE_OVERRIDE name:remove visibility:public modality:OPEN <> ($this:java.util.ArrayList, element:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun remove (element: @[EnhancedNullability] E of java.util.ArrayList): kotlin.Boolean declared in java.util.ArrayList + public abstract fun remove (element: @[FlexibleNullability] kotlin.Int?): @[FlexibleNullability] kotlin.Boolean? declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:element index:0 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override] + overridden: + public open fun removeAt (p0: kotlin.Int): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:removeIf visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.Predicate) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun removeIf (p0: @[EnhancedNullability] java.util.function.Predicate): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.Predicate + FUN FAKE_OVERRIDE name:removeRange visibility:protected/*protected and package*/ modality:OPEN <> ($this:java.util.ArrayList, p0:kotlin.Int, p1:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ open fun removeRange (p0: kotlin.Int, p1: kotlin.Int): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:kotlin.Int + VALUE_PARAMETER name:p1 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:replaceAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Unit [fake_override] + overridden: + public open fun replaceAll (p0: @[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[EnhancedNullability] java.util.function.UnaryOperator<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:OPEN <> ($this:java.util.ArrayList, elements:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int>) returnType:kotlin.Boolean [fake_override] + overridden: + public open fun retainAll (elements: kotlin.collections.Collection<@[EnhancedNullability] E of java.util.ArrayList>): kotlin.Boolean declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<@[EnhancedNullability] kotlin.Int> + FUN FAKE_OVERRIDE name:set visibility:public modality:OPEN <> ($this:java.util.ArrayList, index:kotlin.Int, element:@[EnhancedNullability] kotlin.Int) returnType:@[EnhancedNullability] kotlin.Int [fake_override,operator] + overridden: + public open fun set (index: kotlin.Int, element: @[EnhancedNullability] E of java.util.ArrayList): @[EnhancedNullability] E of java.util.ArrayList declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:@[EnhancedNullability] kotlin.Int + FUN FAKE_OVERRIDE name:sort visibility:public modality:OPEN <> ($this:java.util.ArrayList, p0:@[FlexibleNullability] java.util.Comparator?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun sort (p0: @[FlexibleNullability] java.util.Comparator?): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] java.util.Comparator? + FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] kotlin.Int?> [fake_override] + overridden: + public open fun spliterator (): @[EnhancedNullability] java.util.Spliterator<@[FlexibleNullability] E of java.util.ArrayList?> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:stream visibility:public modality:OPEN <> ($this:kotlin.collections.Collection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun stream (): @[EnhancedNullability] java.util.stream.Stream<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection<@[FlexibleNullability] kotlin.Int?> + FUN FAKE_OVERRIDE name:subList visibility:public modality:OPEN <> ($this:java.util.ArrayList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:@[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] kotlin.Int> [fake_override] + overridden: + public open fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): @[EnhancedNullability] kotlin.collections.MutableList<@[EnhancedNullability] E of java.util.ArrayList> declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:@[FlexibleNullability] kotlin.Array? [fake_override] + overridden: + public open fun toArray (): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + FUN FAKE_OVERRIDE name:toArray visibility:public modality:OPEN ($this:java.util.ArrayList, p0:@[FlexibleNullability] kotlin.Array.B.toArray?>?) returnType:@[FlexibleNullability] kotlin.Array.B.toArray?>? [fake_override] + overridden: + public open fun toArray (p0: @[FlexibleNullability] kotlin.Array?): @[FlexibleNullability] kotlin.Array? declared in java.util.ArrayList + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:java.util.ArrayList + VALUE_PARAMETER name:p0 index:0 type:@[FlexibleNullability] kotlin.Array.B.toArray?>? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.String [fake_override] + overridden: + public open fun toString (): @[EnhancedNullability] kotlin.String declared in java.util.ArrayList + public open fun toString (): kotlin.String declared in .Java1 + $this: VALUE_PARAMETER name: type:java.util.AbstractCollection<@[FlexibleNullability] kotlin.Int?> + FUN FAKE_OVERRIDE name:trimToSize visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Unit [fake_override] + overridden: + public open fun trimToSize (): kotlin.Unit declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList + PROPERTY FAKE_OVERRIDE name:modCount visibility:protected/*protected and package*/ modality:FINAL [fake_override,var] + overridden: + protected/*protected and package*/ final modCount: kotlin.Int + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open size: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:java.util.ArrayList) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:OPEN [fake_override,val] + overridden: + public open fun (): kotlin.Int declared in java.util.ArrayList + $this: VALUE_PARAMETER name: type:java.util.ArrayList diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt new file mode 100644 index 00000000000..fdc987f68ae --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt @@ -0,0 +1,13 @@ +// TARGET_BACKEND: JVM +// FULL_JDK +// SEPARATE_SIGNATURE_DUMP_FOR_K2 +// FILE: Java1.java +public interface Java1 { + Boolean remove(Integer element); +} + +// FILE: 1.kt +import java.util.*; + +abstract class B : ArrayList(), Java1 { +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt.txt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt.txt new file mode 100644 index 00000000000..8fd66bf0dbe --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt.txt @@ -0,0 +1,8 @@ +abstract class B : ArrayList, Java1 { + constructor() /* primary */ { + super/*ArrayList*/<@FlexibleNullability Int?>() + /* () */ + + } + +} diff --git a/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.sig.kt.txt b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.sig.kt.txt new file mode 100644 index 00000000000..f39a3fe9e7e --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.sig.kt.txt @@ -0,0 +1,238 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +abstract class B : ArrayList, Java1 { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#add(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.add|7559962077055454748[0] + // Public signature debug description: add(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun add(element: @EnhancedNullability Int): Boolean + + // CHECK: + // Mangled name: B#add(kotlin.Int;kotlin.Int{EnhancedNullability}){} + // Public signature: /B.add|-3194712170900556378[0] + // Public signature debug description: add(kotlin.Int;kotlin.Int{EnhancedNullability}){} + /* fake */ override fun add(index: Int, element: @EnhancedNullability Int): Unit + + // CHECK JVM_IR: + // Mangled name: B#addAll(kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.addAll|-8818439124580844723[0] + // Public signature debug description: addAll(kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun addAll(elements: @EnhancedNullability Collection<@EnhancedNullability Int>): Boolean + + // CHECK JVM_IR: + // Mangled name: B#addAll(kotlin.Int;kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.addAll|357368019962742687[0] + // Public signature debug description: addAll(kotlin.Int;kotlin.collections.Collection{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun addAll(index: Int, elements: @EnhancedNullability Collection<@EnhancedNullability Int>): Boolean + + // CHECK: + // Mangled name: B#clear(){} + // Public signature: /B.clear|-6446868449915108923[0] + // Public signature debug description: clear(){} + /* fake */ override fun clear(): Unit + + // CHECK JVM_IR: + // Mangled name: B#clone(){}kotlin.Any{EnhancedNullability} + // Public signature: /B.clone|178802004086941196[0] + // Public signature debug description: clone(){}kotlin.Any{EnhancedNullability} + /* fake */ override fun clone(): @EnhancedNullability Any + + // CHECK JVM_IR: + // Mangled name: B#contains(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.contains|3736388240191289860[0] + // Public signature debug description: contains(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + /* fake */ override operator fun contains(element: @EnhancedNullability Int): Boolean + + // CHECK JVM_IR: + // Mangled name: B#containsAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /B.containsAll|-6765067201579764726[0] + // Public signature debug description: containsAll(kotlin.collections.Collection){}kotlin.Boolean + /* fake */ override fun containsAll(elements: Collection<@EnhancedNullability Int>): Boolean + + // CHECK: + // Mangled name: B#ensureCapacity(kotlin.Int){} + // Public signature: /B.ensureCapacity|-7913402150632352615[0] + // Public signature debug description: ensureCapacity(kotlin.Int){} + /* fake */ override fun ensureCapacity(p0: Int): Unit + + // CHECK JVM_IR: + // Mangled name: B#equals(kotlin.Any?{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.equals|4126616015386471185[0] + // Public signature debug description: equals(kotlin.Any?{EnhancedNullability}){}kotlin.Boolean + /* fake */ override operator fun equals(other: @EnhancedNullability Any?): Boolean + + // CHECK: + // Mangled name: B#forEach(java.util.function.Consumer?){} + // Public signature: /B.forEach|5766969768772302175[0] + // Public signature debug description: forEach(java.util.function.Consumer?){} + /* fake */ override fun forEach(p0: Consumer?): Unit + + // CHECK JVM_IR: + // Mangled name: B#get(kotlin.Int){}kotlin.Int{EnhancedNullability} + // Public signature: /B.get|-8822924217357855534[0] + // Public signature debug description: get(kotlin.Int){}kotlin.Int{EnhancedNullability} + /* fake */ override operator fun get(index: Int): @EnhancedNullability Int + + // CHECK JVM_IR: + // Mangled name: B#hashCode(){}kotlin.Int + // Public signature: /B.hashCode|-8048879360829830756[0] + // Public signature debug description: hashCode(){}kotlin.Int + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: B#indexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + // Public signature: /B.indexOf|866974352596659798[0] + // Public signature debug description: indexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + /* fake */ override fun indexOf(element: @EnhancedNullability Int): Int + + // CHECK JVM_IR: + // Mangled name: B#isEmpty(){}kotlin.Boolean + // Public signature: /B.isEmpty|-626562167393617703[0] + // Public signature debug description: isEmpty(){}kotlin.Boolean + /* fake */ override fun isEmpty(): Boolean + + // CHECK JVM_IR: + // Mangled name: B#iterator(){}kotlin.collections.MutableIterator{EnhancedNullability} + // Public signature: /B.iterator|115627760567581658[0] + // Public signature debug description: iterator(){}kotlin.collections.MutableIterator{EnhancedNullability} + /* fake */ override operator fun iterator(): @EnhancedNullability MutableIterator<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#lastIndexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + // Public signature: /B.lastIndexOf|1115527748420890033[0] + // Public signature debug description: lastIndexOf(kotlin.Int{EnhancedNullability}){}kotlin.Int + /* fake */ override fun lastIndexOf(element: @EnhancedNullability Int): Int + + // CHECK JVM_IR: + // Mangled name: B#listIterator(){}kotlin.collections.MutableListIterator{EnhancedNullability} + // Public signature: /B.listIterator|4960815808465755041[0] + // Public signature debug description: listIterator(){}kotlin.collections.MutableListIterator{EnhancedNullability} + /* fake */ override fun listIterator(): @EnhancedNullability MutableListIterator<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#listIterator(kotlin.Int){}kotlin.collections.MutableListIterator{EnhancedNullability} + // Public signature: /B.listIterator|-2268028930611070307[0] + // Public signature debug description: listIterator(kotlin.Int){}kotlin.collections.MutableListIterator{EnhancedNullability} + /* fake */ override fun listIterator(index: Int): @EnhancedNullability MutableListIterator<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#parallelStream(){}java.util.stream.Stream{EnhancedNullability} + // Public signature: /B.parallelStream|7878330035109535908[0] + // Public signature debug description: parallelStream(){}java.util.stream.Stream{EnhancedNullability} + /* fake */ override fun parallelStream(): @EnhancedNullability Stream<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#remove(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.remove|2933193249427016334[0] + // Public signature debug description: remove(kotlin.Int{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun remove(element: @EnhancedNullability Int): Boolean + + // CHECK JVM_IR: + // Mangled name: B#removeAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /B.removeAll|-5493620261823900507[0] + // Public signature debug description: removeAll(kotlin.collections.Collection){}kotlin.Boolean + /* fake */ override fun removeAll(elements: Collection<@EnhancedNullability Int>): Boolean + + // CHECK JVM_IR: + // Mangled name: B#removeAt(kotlin.Int){}kotlin.Int{EnhancedNullability} + // Public signature: /B.removeAt|6480490686215931144[0] + // Public signature debug description: removeAt(kotlin.Int){}kotlin.Int{EnhancedNullability} + /* fake */ override fun removeAt(p0: Int): @EnhancedNullability Int + + // CHECK JVM_IR: + // Mangled name: B#removeIf(java.util.function.Predicate{EnhancedNullability}){}kotlin.Boolean + // Public signature: /B.removeIf|-1099538878717265414[0] + // Public signature debug description: removeIf(java.util.function.Predicate{EnhancedNullability}){}kotlin.Boolean + /* fake */ override fun removeIf(p0: @EnhancedNullability Predicate): Boolean + + // CHECK: + // Mangled name: B#removeRange(kotlin.Int;kotlin.Int){} + // Public signature: /B.removeRange|7632320944993890593[0] + // Public signature debug description: removeRange(kotlin.Int;kotlin.Int){} + protected_and_package /* fake */ override fun removeRange(p0: Int, p1: Int): Unit + + // CHECK: + // Mangled name: B#replaceAll(java.util.function.UnaryOperator{EnhancedNullability}){} + // Public signature: /B.replaceAll|6373979877176729001[0] + // Public signature debug description: replaceAll(java.util.function.UnaryOperator{EnhancedNullability}){} + /* fake */ override fun replaceAll(p0: @EnhancedNullability UnaryOperator<@EnhancedNullability Int>): Unit + + // CHECK JVM_IR: + // Mangled name: B#retainAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /B.retainAll|-3550913358824719637[0] + // Public signature debug description: retainAll(kotlin.collections.Collection){}kotlin.Boolean + /* fake */ override fun retainAll(elements: Collection<@EnhancedNullability Int>): Boolean + + // CHECK JVM_IR: + // Mangled name: B#set(kotlin.Int;kotlin.Int{EnhancedNullability}){}kotlin.Int{EnhancedNullability} + // Public signature: /B.set|-7932912415931410975[0] + // Public signature debug description: set(kotlin.Int;kotlin.Int{EnhancedNullability}){}kotlin.Int{EnhancedNullability} + /* fake */ override operator fun set(index: Int, element: @EnhancedNullability Int): @EnhancedNullability Int + + // CHECK: + // Mangled name: B#sort(java.util.Comparator?){} + // Public signature: /B.sort|8069876015820305517[0] + // Public signature debug description: sort(java.util.Comparator?){} + /* fake */ override fun sort(p0: Comparator?): Unit + + // CHECK JVM_IR: + // Mangled name: B#spliterator(){}java.util.Spliterator{EnhancedNullability} + // Public signature: /B.spliterator|-3709449862893660489[0] + // Public signature debug description: spliterator(){}java.util.Spliterator{EnhancedNullability} + /* fake */ override fun spliterator(): @EnhancedNullability Spliterator + + // CHECK JVM_IR: + // Mangled name: B#stream(){}java.util.stream.Stream{EnhancedNullability} + // Public signature: /B.stream|5410141522529844650[0] + // Public signature debug description: stream(){}java.util.stream.Stream{EnhancedNullability} + /* fake */ override fun stream(): @EnhancedNullability Stream<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#subList(kotlin.Int;kotlin.Int){}kotlin.collections.MutableList{EnhancedNullability} + // Public signature: /B.subList|127837164145565172[0] + // Public signature debug description: subList(kotlin.Int;kotlin.Int){}kotlin.collections.MutableList{EnhancedNullability} + /* fake */ override fun subList(fromIndex: Int, toIndex: Int): @EnhancedNullability MutableList<@EnhancedNullability Int> + + // CHECK JVM_IR: + // Mangled name: B#toArray(){}kotlin.Array? + // Public signature: /B.toArray|-8468800257910341540[0] + // Public signature debug description: toArray(){}kotlin.Array? + /* fake */ override fun toArray(): Array? + + // CHECK JVM_IR: + // Mangled name: B#toArray(kotlin.Array?){0§}kotlin.Array? + // Public signature: /B.toArray|-7248906015406159030[0] + // Public signature debug description: toArray(kotlin.Array?){0§}kotlin.Array? + /* fake */ override fun toArray(p0: Array?): Array? + + // CHECK JVM_IR: + // Mangled name: B#toString(){}kotlin.String{EnhancedNullability} + // Public signature: /B.toString|7581629773206850948[0] + // Public signature debug description: toString(){}kotlin.String{EnhancedNullability} + /* fake */ override fun toString(): @EnhancedNullability String + + // CHECK: + // Mangled name: B#trimToSize(){} + // Public signature: /B.trimToSize|-5937642362792008740[0] + // Public signature debug description: trimToSize(){} + /* fake */ override fun trimToSize(): Unit + + // CHECK: + // Mangled name: B{}size + // Public signature: /B.size|-6253659984320132064[0] + // Public signature debug description: {}size + /* fake */ override val size: Int + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Int + // Public signature: /B.size.|-3941649985161900780[0] + // Public signature debug description: (){}kotlin.Int + /* fake */ override get(): Int + +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 9f3dafd16c6..063f832dd7c 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -22721,6 +22721,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/diagnostics/tests/j+k/collectionOverrides/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantCharAtAbstract.kt") public void testIrrelevantCharAtAbstract() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java index 7273f61efe5..6712cb067d9 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java @@ -30819,6 +30819,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -51309,6 +51315,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index bc3bb00db8e..9973dc4f833 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -29013,6 +29013,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 1f2350127e6..7154988c6c8 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -30819,6 +30819,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -51361,6 +51367,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 135722b7334..7dc01df57f7 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -30819,6 +30819,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @Test + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @Test @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { @@ -51361,6 +51367,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @Test @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index 38cfacaf108..349c0f7ecd6 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -2703,6 +2703,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest public void testFakeOverrideOfRawJavaCollection() { runTest("compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.kt"); } + + @Test + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/ir/irText/fakeOverrides/intersectionWithMappedSignature.kt"); + } } @Nested diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 289485e96b4..7e3515a9c24 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -26067,6 +26067,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/javaInterop/genericSamSmartcast.kt"); } + @TestMetadata("immutableName.kt") + public void testImmutableName() { + runTest("compiler/testData/codegen/box/javaInterop/immutableName.kt"); + } + @TestMetadata("inheritanceWithWildcard.kt") public void testInheritanceWithWildcard() { runTest("compiler/testData/codegen/box/javaInterop/inheritanceWithWildcard.kt"); @@ -41330,6 +41335,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt"); } + @TestMetadata("intersectionWithMappedSignature.kt") + public void testIntersectionWithMappedSignature() { + runTest("compiler/testData/codegen/box/specialBuiltins/intersectionWithMappedSignature.kt"); + } + @TestMetadata("irrelevantRemoveAndJavaList.kt") public void testIrrelevantRemoveAndJavaList() { runTest("compiler/testData/codegen/box/specialBuiltins/irrelevantRemoveAndJavaList.kt");