[Test] Add tests for KT-63076

This commit is contained in:
Dmitriy Novozhilov
2023-12-11 16:30:48 +02:00
committed by Space Team
parent 63d615d220
commit be6694f049
10 changed files with 410 additions and 0 deletions
@@ -22419,6 +22419,30 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_javaOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_javaOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_javaOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_kotlinOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_kotlinOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_kotlinOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_1() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_2() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt");
}
@Test
@TestMetadata("unitVsVoid.kt")
public void testUnitVsVoid() throws Exception {
@@ -22419,6 +22419,30 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_javaOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_javaOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_javaOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_kotlinOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_kotlinOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_kotlinOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_1() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_2() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt");
}
@Test
@TestMetadata("unitVsVoid.kt")
public void testUnitVsVoid() throws Exception {
@@ -22413,6 +22413,30 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_javaOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_javaOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_javaOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_kotlinOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_kotlinOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_kotlinOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_1() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_2() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt");
}
@Test
@TestMetadata("unitVsVoid.kt")
public void testUnitVsVoid() throws Exception {
@@ -22419,6 +22419,30 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_javaOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_javaOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_javaOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_kotlinOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_kotlinOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_kotlinOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_1() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_2() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt");
}
@Test
@TestMetadata("unitVsVoid.kt")
public void testUnitVsVoid() throws Exception {
@@ -0,0 +1,58 @@
// FIR_IDENTICAL
// ISSUE: KT-63076
// FILE: A.java
public class A {
public String getX1() { return ""; }
public String getX2() { return ""; }
public String getX3() { return ""; }
public String getX4() { return ""; }
}
// FILE: B.kt
open class B : A() {
override fun getX2(): String = ""
override fun getX3(): String = ""
override fun getX4(): String = ""
}
// FILE: C.java
public class C extends B {
public String getX3() { return ""; }
public String getX4() { return ""; }
}
// FILE: D.kt
open class D : C() {
override fun getX4(): String = ""
}
// FILE: main.kt
fun test_1(a: A) {
a.x1
a.x2
a.x3
a.x4
}
fun test_2(b: B) {
b.x1
b.x2
b.x3
b.x4
}
fun test_3(c: C) {
c.x1
c.x2
c.x3
c.x4
}
fun test_4(d: D) {
d.x1
d.x2
d.x3
d.x4
}
@@ -0,0 +1,57 @@
// ISSUE: KT-63076
// FILE: A.kt
open class A {
open fun getX1(): String = ""
open fun getX2(): String = ""
open fun getX3(): String = ""
open fun getX4(): String = ""
}
// FILE: B.java
public class B extends A {
public String getX2() { return ""; }
public String getX3() { return ""; }
public String getX4() { return ""; }
}
// FILE: C.kt
open class C : B() {
override fun getX3(): String = ""
override fun getX4(): String = ""
}
// FILE: D.java
public class D extends C {
public String getX4() { return ""; }
}
// FILE: main.kt
fun test_1(a: A) {
a.<!UNRESOLVED_REFERENCE!>x1<!>
a.<!UNRESOLVED_REFERENCE!>x2<!>
a.<!UNRESOLVED_REFERENCE!>x3<!>
a.<!UNRESOLVED_REFERENCE!>x4<!>
}
fun test_2(b: B) {
b.x1
b.x2
b.x3
b.x4
}
fun test_3(c: C) {
c.x1
c.x2
c.x3
c.x4
}
fun test_4(d: D) {
d.x1
d.x2
d.x3
d.x4
}
@@ -0,0 +1,57 @@
// ISSUE: KT-63076
// FILE: A.kt
open class A {
open fun getX1(): String = ""
open fun getX2(): String = ""
open fun getX3(): String = ""
open fun getX4(): String = ""
}
// FILE: B.java
public class B extends A {
public String getX2() { return ""; }
public String getX3() { return ""; }
public String getX4() { return ""; }
}
// FILE: C.kt
open class C : B() {
override fun getX3(): String = ""
override fun getX4(): String = ""
}
// FILE: D.java
public class D extends C {
public String getX4() { return ""; }
}
// FILE: main.kt
fun test_1(a: A) {
a.<!UNRESOLVED_REFERENCE!>x1<!>
a.<!UNRESOLVED_REFERENCE!>x2<!>
a.<!UNRESOLVED_REFERENCE!>x3<!>
a.<!UNRESOLVED_REFERENCE!>x4<!>
}
fun test_2(b: B) {
b.<!UNRESOLVED_REFERENCE!>x1<!>
b.<!UNRESOLVED_REFERENCE!>x2<!>
b.<!UNRESOLVED_REFERENCE!>x3<!>
b.<!UNRESOLVED_REFERENCE!>x4<!>
}
fun test_3(c: C) {
c.<!UNRESOLVED_REFERENCE!>x1<!>
c.<!UNRESOLVED_REFERENCE!>x2<!>
c.<!UNRESOLVED_REFERENCE!>x3<!>
c.<!UNRESOLVED_REFERENCE!>x4<!>
}
fun test_4(d: D) {
d.<!UNRESOLVED_REFERENCE!>x1<!>
d.<!UNRESOLVED_REFERENCE!>x2<!>
d.<!UNRESOLVED_REFERENCE!>x3<!>
d.<!UNRESOLVED_REFERENCE!>x4<!>
}
@@ -0,0 +1,59 @@
// FIR_IDENTICAL
// ISSUE: KT-63076
// FILE: AK.kt
open class AK {
open fun getX1(): String = ""
open fun getX2(): String = ""
open fun getX3(): String = ""
open fun getX4(): String = ""
}
// FILE: AJ.java
public interface AJ {
String getX1();
String getX2();
String getX3();
String getX4();
}
// FILE: B.java
public class B extends AK implements AJ {
public String getX2() { return ""; }
public String getX3() { return ""; }
public String getX4() { return ""; }
}
// FILE: C.kt
open class C : B() {
override fun getX3(): String = ""
override fun getX4(): String = ""
}
// FILE: D.java
public class D extends C {
public String getX4() { return ""; }
}
// FILE: main.kt
fun test_1(b: B) {
b.x1
b.x2
b.x3
b.x4
}
fun test_2(c: C) {
c.x1
c.x2
c.x3
c.x4
}
fun test_3(d: D) {
d.x1
d.x2
d.x3
d.x4
}
@@ -0,0 +1,59 @@
// FIR_IDENTICAL
// ISSUE: KT-63076
// FILE: AK.kt
open class AK {
open fun getX1(): String = ""
open fun getX2(): String = ""
open fun getX3(): String = ""
open fun getX4(): String = ""
}
// FILE: AJ.java
public interface AJ {
String getX1();
String getX2();
String getX3();
String getX4();
}
// FILE: B.kt
open class B : AK(), AJ {
override fun getX2(): String = ""
override fun getX3(): String = ""
override fun getX4(): String = ""
}
// FILE: C.java
public class C extends B {
public String getX3() { return ""; }
public String getX4() { return ""; }
}
// FILE: D.kt
open class D : C() {
override fun getX4(): String = ""
}
// FILE: main.kt
fun test_1(b: B) {
b.x1
b.x2
b.x3
b.x4
}
fun test_2(c: C) {
c.x1
c.x2
c.x3
c.x4
}
fun test_3(d: D) {
d.x1
d.x2
d.x3
d.x4
}
@@ -22419,6 +22419,30 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_javaOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_javaOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_javaOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_kotlinOrigin.kt")
public void testSyntheticPropertyFromKotlinGetter_kotlinOrigin() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_kotlinOrigin.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_1() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_1.kt");
}
@Test
@TestMetadata("syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt")
public void testSyntheticPropertyFromKotlinGetter_mixedOrigin_2() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/properties/syntheticPropertyFromKotlinGetter_mixedOrigin_2.kt");
}
@Test
@TestMetadata("unitVsVoid.kt")
public void testUnitVsVoid() throws Exception {