From 3f95e99e291ffbad1c29e4368b5813e6ac91b886 Mon Sep 17 00:00:00 2001 From: Roman Efremov Date: Thu, 7 Dec 2023 16:48:24 +0100 Subject: [PATCH] [Tests] Add tests for matching of expect property against Java property ...via typealias. Java property can be either field or method, which overrides Kotlin property. ^KT-63624 --- ...CompilerTestFE10TestdataTestGenerated.java | 42 +++++++++++++++++++ ...sticCompilerFE10TestDataTestGenerated.java | 42 +++++++++++++++++++ ...DiagnosticsWithLightTreeTestGenerated.java | 42 +++++++++++++++++++ ...endMPPDiagnosticsWithPsiTestGenerated.java | 42 +++++++++++++++++++ .../java/propertyAgainstFakeOverrideInJava.kt | 19 +++++++++ .../java/propertyAgainstJavaMethod.kt | 22 ++++++++++ ...instJavaPrivateFieldAndPublicMethod.fir.kt | 23 ++++++++++ ...yAgainstJavaPrivateFieldAndPublicMethod.kt | 23 ++++++++++ ...nstJavaPublicFieldAndPublicGetter.fir.fail | 1 + ...tyAgainstJavaPublicFieldAndPublicGetter.kt | 24 +++++++++++ ...propertyAgainstValInJavaWithExtraSetter.kt | 25 +++++++++++ .../java/varPropertyAgainstJavaField.fir.fail | 1 + .../java/varPropertyAgainstJavaField.kt | 15 +++++++ ...AgainstJavaGetterAndNonFinalField.fir.fail | 1 + ...opertyAgainstJavaGetterAndNonFinalField.kt | 24 +++++++++++ .../test/runners/DiagnosticTestGenerated.java | 42 +++++++++++++++++++ 16 files changed, 388 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.fir.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.fir.fail create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.fir.fail create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.fir.fail create mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt 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 60ae37c8137..55d06d074fb 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 @@ -26190,6 +26190,48 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia public void testParameterNames() throws Exception { runTest("compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt"); } + + @Test + @TestMetadata("propertyAgainstFakeOverrideInJava.kt") + public void testPropertyAgainstFakeOverrideInJava() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaMethod.kt") + public void testPropertyAgainstJavaMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPrivateFieldAndPublicMethod.kt") + public void testPropertyAgainstJavaPrivateFieldAndPublicMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPublicFieldAndPublicGetter.kt") + public void testPropertyAgainstJavaPublicFieldAndPublicGetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt"); + } + + @Test + @TestMetadata("propertyAgainstValInJavaWithExtraSetter.kt") + public void testPropertyAgainstValInJavaWithExtraSetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaField.kt") + public void testVarPropertyAgainstJavaField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaGetterAndNonFinalField.kt") + public void testVarPropertyAgainstJavaGetterAndNonFinalField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt"); + } } @Nested 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 c160693a1d7..8e8d0e92bf9 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 @@ -26190,6 +26190,48 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated public void testParameterNames() throws Exception { runTest("compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt"); } + + @Test + @TestMetadata("propertyAgainstFakeOverrideInJava.kt") + public void testPropertyAgainstFakeOverrideInJava() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaMethod.kt") + public void testPropertyAgainstJavaMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPrivateFieldAndPublicMethod.kt") + public void testPropertyAgainstJavaPrivateFieldAndPublicMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPublicFieldAndPublicGetter.kt") + public void testPropertyAgainstJavaPublicFieldAndPublicGetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt"); + } + + @Test + @TestMetadata("propertyAgainstValInJavaWithExtraSetter.kt") + public void testPropertyAgainstValInJavaWithExtraSetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaField.kt") + public void testVarPropertyAgainstJavaField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaGetterAndNonFinalField.kt") + public void testVarPropertyAgainstJavaGetterAndNonFinalField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt"); + } } @Nested diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java index c2bab778944..f3f6ad35a09 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java @@ -1959,6 +1959,48 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst public void testParameterNames() throws Exception { runTest("compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt"); } + + @Test + @TestMetadata("propertyAgainstFakeOverrideInJava.kt") + public void testPropertyAgainstFakeOverrideInJava() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaMethod.kt") + public void testPropertyAgainstJavaMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPrivateFieldAndPublicMethod.kt") + public void testPropertyAgainstJavaPrivateFieldAndPublicMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPublicFieldAndPublicGetter.kt") + public void testPropertyAgainstJavaPublicFieldAndPublicGetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt"); + } + + @Test + @TestMetadata("propertyAgainstValInJavaWithExtraSetter.kt") + public void testPropertyAgainstValInJavaWithExtraSetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaField.kt") + public void testVarPropertyAgainstJavaField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaGetterAndNonFinalField.kt") + public void testVarPropertyAgainstJavaGetterAndNonFinalField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt"); + } } @Nested diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java index 0e69b1827d8..ebfe2749e72 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java @@ -1959,6 +1959,48 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi public void testParameterNames() throws Exception { runTest("compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt"); } + + @Test + @TestMetadata("propertyAgainstFakeOverrideInJava.kt") + public void testPropertyAgainstFakeOverrideInJava() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaMethod.kt") + public void testPropertyAgainstJavaMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPrivateFieldAndPublicMethod.kt") + public void testPropertyAgainstJavaPrivateFieldAndPublicMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPublicFieldAndPublicGetter.kt") + public void testPropertyAgainstJavaPublicFieldAndPublicGetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt"); + } + + @Test + @TestMetadata("propertyAgainstValInJavaWithExtraSetter.kt") + public void testPropertyAgainstValInJavaWithExtraSetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaField.kt") + public void testVarPropertyAgainstJavaField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaGetterAndNonFinalField.kt") + public void testVarPropertyAgainstJavaGetterAndNonFinalField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt"); + } } @Nested diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt new file mode 100644 index 00000000000..983eed61108 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt @@ -0,0 +1,19 @@ +// FIR_IDENTICAL +// MODULE: m1-common +// FILE: common.kt +expect class Foo { + val foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +interface I { + val foo: Int + get() = 1 +} + +actual typealias Foo = JavaFoo + +// FILE: JavaFoo.java +public class JavaFoo implements I { +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt new file mode 100644 index 00000000000..d06a4259ca6 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt @@ -0,0 +1,22 @@ +// FIR_IDENTICAL +// MODULE: m1-common +// FILE: common.kt +expect class Foo { + val foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +actual typealias Foo = JavaFoo + +interface I { + val foo: Int +} + +// FILE: JavaFoo.java +public class JavaFoo implements I { + @Override + public int getFoo() { + return 0; + } +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.fir.kt new file mode 100644 index 00000000000..6b47b89be2f --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.fir.kt @@ -0,0 +1,23 @@ +// MODULE: m1-common +// FILE: common.kt +interface I { + val foo: Int +} + +expect class Foo : I { + override val foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +actual typealias Foo = JavaFoo + +// FILE: JavaFoo.java +public class JavaFoo implements I { + private final int foo = 1; + + @Override + public int getFoo() { + return 0; + } +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt new file mode 100644 index 00000000000..9b7ebeeabef --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt @@ -0,0 +1,23 @@ +// MODULE: m1-common +// FILE: common.kt +interface I { + val foo: Int +} + +expect class Foo : I { + override val foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +actual typealias Foo = JavaFoo + +// FILE: JavaFoo.java +public class JavaFoo implements I { + private final int foo = 1; + + @Override + public int getFoo() { + return 0; + } +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.fir.fail b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.fir.fail new file mode 100644 index 00000000000..35dc1cfbea0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.fir.fail @@ -0,0 +1 @@ +Fails in K2 due to KT-63667 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt new file mode 100644 index 00000000000..7849c8b7159 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt @@ -0,0 +1,24 @@ +// FIR_IDENTICAL +// MODULE: m1-common +// FILE: common.kt +expect class Foo { + val foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +actual typealias Foo = JavaFoo + +interface I { + val foo: Int +} + +// FILE: JavaFoo.java +public class JavaFoo implements I { + public final int foo = 1; + + @Override + public int getFoo() { + return 0; + } +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt new file mode 100644 index 00000000000..b32b8f31d5e --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt @@ -0,0 +1,25 @@ +// FIR_IDENTICAL +// MODULE: m1-common +// FILE: common.kt +expect class Foo { + val foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +interface I { + val foo: Int +} + +actual typealias Foo = JavaFoo + +// FILE: JavaFoo.java +public class JavaFoo implements I { + @Override + public int getFoo() { + return 0; + } + + public void setFoo(int i) { + } +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.fir.fail b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.fir.fail new file mode 100644 index 00000000000..35dc1cfbea0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.fir.fail @@ -0,0 +1 @@ +Fails in K2 due to KT-63667 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt new file mode 100644 index 00000000000..5c005d793cb --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt @@ -0,0 +1,15 @@ +// FIR_IDENTICAL +// MODULE: m1-common +// FILE: common.kt +expect class Foo { + var foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +actual typealias Foo = JavaFoo + +// FILE: JavaFoo.java +public class JavaFoo { + public int foo = 0; +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.fir.fail b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.fir.fail new file mode 100644 index 00000000000..35dc1cfbea0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.fir.fail @@ -0,0 +1 @@ +Fails in K2 due to KT-63667 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt new file mode 100644 index 00000000000..a4d2fc6475b --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt @@ -0,0 +1,24 @@ +// FIR_IDENTICAL +// MODULE: m1-common +// FILE: common.kt +expect class Foo { + var foo: Int +} + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt +interface I { + val foo: Int +} + +actual typealias Foo = JavaFoo + +// FILE: JavaFoo.java +public class JavaFoo implements I { + public int foo; + + @Override + public int getFoo() { + return 0; + } +} 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 f5d176f427d..219ca296ba3 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 @@ -26190,6 +26190,48 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { public void testParameterNames() throws Exception { runTest("compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt"); } + + @Test + @TestMetadata("propertyAgainstFakeOverrideInJava.kt") + public void testPropertyAgainstFakeOverrideInJava() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaMethod.kt") + public void testPropertyAgainstJavaMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPrivateFieldAndPublicMethod.kt") + public void testPropertyAgainstJavaPrivateFieldAndPublicMethod() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt"); + } + + @Test + @TestMetadata("propertyAgainstJavaPublicFieldAndPublicGetter.kt") + public void testPropertyAgainstJavaPublicFieldAndPublicGetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt"); + } + + @Test + @TestMetadata("propertyAgainstValInJavaWithExtraSetter.kt") + public void testPropertyAgainstValInJavaWithExtraSetter() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstValInJavaWithExtraSetter.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaField.kt") + public void testVarPropertyAgainstJavaField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaField.kt"); + } + + @Test + @TestMetadata("varPropertyAgainstJavaGetterAndNonFinalField.kt") + public void testVarPropertyAgainstJavaGetterAndNonFinalField() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt"); + } } @Nested