[FIR] Add a blackbox test for failure #2 of KT-65972

^KT-65972
This commit is contained in:
Nikolay Lunyak
2024-02-21 14:58:17 +02:00
committed by Space Team
parent 341a23d05c
commit 39cbe3fb35
11 changed files with 100 additions and 0 deletions
@@ -31627,6 +31627,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -31627,6 +31627,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -31496,6 +31496,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -31496,6 +31496,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -31496,6 +31496,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -0,0 +1,41 @@
// TARGET_BACKEND: JVM
// SKIP_JDK6
// JVM_TARGET: 1.8
// FILE: ColoredTextContainer.java
public interface ColoredTextContainer {
default void setToolTipText(String text) {}
}
// FILE: JComponent.java
public abstract class JComponent {
public void setToolTipText(String text) {}
}
// FILE: SimpleColoredComponent.java
// IDEALLY:
// Provides `IO SimpleColoredComponent::setToolTipText`, because inherits
// `JComponent::setToolTipText` and `ColoredTextContainer::setToolTipText`,
// which don't sumbsume one another, but Java allows picking the class-based one in this case.
// REALITY:
// Contains an IO for the above. We check if this is green Java via a
// modified check that accounts for this case.
public class SimpleColoredComponent extends JComponent implements ColoredTextContainer {}
// FILE: Main.kt
// Not important, left for the record
interface TextFragment : ColoredTextContainer
// IDEALLY:
// Provides `JComponent::setToolTipText`, because inherits
// `ColoredTextContainer::setToolTipText` and `IO SimpleColoredComponent::setToolTipText`,
// and the latter subsumes the former.
// REALITY:
// Contains IO between `ColoredTextContainer::setToolTipText` and `IO SimpleColoredComponent::setToolTipText`.
// In this case `IO SimpleColoredComponent::setToolTipText` should not be unwrapped, otherwise
// we miss `nonSubsumed()` check and since this is a Kotlin class we are not allowed to implicitly choose
// between `JComponent::setToolTipText` and `ColoredTextContainer::setToolTipText`.
private class TextFragmentImpl : TextFragment, SimpleColoredComponent()
fun box() = "OK".also { TextFragmentImpl() }
@@ -31496,6 +31496,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -29672,6 +29672,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -31496,6 +31496,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -31496,6 +31496,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@Test
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@Test
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
@@ -26673,6 +26673,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJava.kt");
}
@TestMetadata("intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt")
public void testIntersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/intersectionWithMultipleDefaultsInJavaOverriddenByIntersectionInKotlin.kt");
}
@TestMetadata("nullableInt.kt")
public void testNullableInt() {
runTest("compiler/testData/codegen/box/javaInterop/primitiveVsWrapperTypeInInheritance/nullableInt.kt");