K2: add BB tests for KT-59380 working properly (compiler error in K1)
#KT-59380 As Designed
This commit is contained in:
committed by
Space Team
parent
dab9ac3b1c
commit
36dd9b6818
+18
@@ -20168,6 +20168,24 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+18
@@ -20168,6 +20168,24 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+18
@@ -19897,6 +19897,24 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+18
@@ -19897,6 +19897,24 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+18
@@ -19897,6 +19897,24 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// IGNORE_BACKEND_K1: JVM_IR
|
||||||
|
// IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION
|
||||||
|
// Both K1 and K2 with IR f/o generator report ACCIDENTAL_OVERRIDE on B.foo (see also KT-60283)
|
||||||
|
// ISSUE: KT-59380
|
||||||
|
|
||||||
|
// FILE: A.java
|
||||||
|
|
||||||
|
public class A {
|
||||||
|
public static String foo() {
|
||||||
|
return "FAIL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: box.kt
|
||||||
|
|
||||||
|
class B : A() {
|
||||||
|
fun foo() = "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = B().foo()
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// IGNORE_BACKEND_K1: JVM_IR
|
||||||
|
// IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION
|
||||||
|
// Both K1 and K2 with IR f/o generator report ACCIDENTAL_OVERRIDE on B.foo (see also KT-60283)
|
||||||
|
// ISSUE: KT-59830
|
||||||
|
|
||||||
|
// FILE: A.java
|
||||||
|
|
||||||
|
public class A {
|
||||||
|
public static void foo() {}
|
||||||
|
public static void baz(String s) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: B.kt
|
||||||
|
|
||||||
|
open class B : A() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: C.java
|
||||||
|
|
||||||
|
public class C extends B {
|
||||||
|
public static void bar(int i) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: K.kt
|
||||||
|
|
||||||
|
open class K : C() {
|
||||||
|
fun foo() {}
|
||||||
|
fun foo(a: Any) {}
|
||||||
|
fun bar(i: Int) {}
|
||||||
|
fun bar(i: String) {}
|
||||||
|
fun baz(i: Int) {}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun foo() {}
|
||||||
|
fun bar(i: Int) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
A.foo()
|
||||||
|
A.baz("")
|
||||||
|
C.bar(0)
|
||||||
|
K.foo()
|
||||||
|
K.bar(0)
|
||||||
|
val k = K()
|
||||||
|
k.foo()
|
||||||
|
k.foo(0.0)
|
||||||
|
k.bar(0)
|
||||||
|
k.bar("")
|
||||||
|
k.baz(0)
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
// ISSUE: KT-59380
|
||||||
|
|
||||||
|
// FILE: A.java
|
||||||
|
|
||||||
|
public interface A {
|
||||||
|
static String foo() {
|
||||||
|
return "FAIL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: box.kt
|
||||||
|
|
||||||
|
class B : A {
|
||||||
|
fun foo() = "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = B().foo()
|
||||||
+18
@@ -19897,6 +19897,24 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+18
@@ -19897,6 +19897,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+18
@@ -19897,6 +19897,24 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void testKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
|
|||||||
+15
@@ -16397,6 +16397,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt");
|
runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride.kt")
|
||||||
|
public void ignoreKotlinJavaStaticAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlinJavaStaticAccidentalOverride2.kt")
|
||||||
|
public void ignoreKotlinJavaStaticAccidentalOverride2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticAccidentalOverride2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("selectingLambdas.kt")
|
@TestMetadata("selectingLambdas.kt")
|
||||||
public void ignoreSelectingLambdas() throws Exception {
|
public void ignoreSelectingLambdas() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
|
runTest("compiler/testData/codegen/box/fir/selectingLambdas.kt");
|
||||||
@@ -16630,6 +16640,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaKotlin.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlinJavaStaticFromInterfaceAccidentalOverride.kt")
|
||||||
|
public void testKotlinJavaStaticFromInterfaceAccidentalOverride() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/fir/kotlinJavaStaticFromInterfaceAccidentalOverride.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt61856.kt")
|
@TestMetadata("kt61856.kt")
|
||||||
public void testKt61856() throws Exception {
|
public void testKt61856() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/fir/kt61856.kt");
|
runTest("compiler/testData/codegen/box/fir/kt61856.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user