[Test] Write reproducer test for expect-actual matching to Java field
..., which comes from super class, which incorrectly works in K2. ^KT-63624
This commit is contained in:
committed by
Space Team
parent
bb044bb57e
commit
3d2a37ee41
+6
@@ -26551,6 +26551,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyAgainstFakeOverrideOfJavaField.kt")
|
||||||
|
public void testPropertyAgainstFakeOverrideOfJavaField() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideOfJavaField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyAgainstJavaMethod.kt")
|
@TestMetadata("propertyAgainstJavaMethod.kt")
|
||||||
public void testPropertyAgainstJavaMethod() throws Exception {
|
public void testPropertyAgainstJavaMethod() throws Exception {
|
||||||
|
|||||||
+6
@@ -26551,6 +26551,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyAgainstFakeOverrideOfJavaField.kt")
|
||||||
|
public void testPropertyAgainstFakeOverrideOfJavaField() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideOfJavaField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyAgainstJavaMethod.kt")
|
@TestMetadata("propertyAgainstJavaMethod.kt")
|
||||||
public void testPropertyAgainstJavaMethod() throws Exception {
|
public void testPropertyAgainstJavaMethod() throws Exception {
|
||||||
|
|||||||
+6
@@ -1978,6 +1978,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyAgainstFakeOverrideOfJavaField.kt")
|
||||||
|
public void testPropertyAgainstFakeOverrideOfJavaField() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideOfJavaField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyAgainstJavaMethod.kt")
|
@TestMetadata("propertyAgainstJavaMethod.kt")
|
||||||
public void testPropertyAgainstJavaMethod() throws Exception {
|
public void testPropertyAgainstJavaMethod() throws Exception {
|
||||||
|
|||||||
+6
@@ -1978,6 +1978,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyAgainstFakeOverrideOfJavaField.kt")
|
||||||
|
public void testPropertyAgainstFakeOverrideOfJavaField() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideOfJavaField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyAgainstJavaMethod.kt")
|
@TestMetadata("propertyAgainstJavaMethod.kt")
|
||||||
public void testPropertyAgainstJavaMethod() throws Exception {
|
public void testPropertyAgainstJavaMethod() throws Exception {
|
||||||
|
|||||||
compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideOfJavaField.fir.kt
Vendored
+28
@@ -0,0 +1,28 @@
|
|||||||
|
// MODULE: m1-common
|
||||||
|
// FILE: common.kt
|
||||||
|
expect class MyHashMap<K, V> {
|
||||||
|
val values: Collection<V>
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
|
// FILE: jvm.kt
|
||||||
|
interface MyMap<K, V> {
|
||||||
|
val values: Collection<V>
|
||||||
|
}
|
||||||
|
|
||||||
|
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>MyHashMap<!><K, V> = MyHashMapJava<K, V>
|
||||||
|
|
||||||
|
// FILE: MyHashMapJava.java
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public final class MyHashMapJava<K, V> extends AbstractMyHashMap<K, V> {
|
||||||
|
// fake override of field AbstractMyHashMap.values
|
||||||
|
}
|
||||||
|
abstract class AbstractMyHashMap<K, V> implements MyMap<K, V> {
|
||||||
|
protected Collection<V> values;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<V> getValues() {
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+28
@@ -0,0 +1,28 @@
|
|||||||
|
// MODULE: m1-common
|
||||||
|
// FILE: common.kt
|
||||||
|
expect class MyHashMap<K, V> {
|
||||||
|
val values: Collection<V>
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: m2-jvm()()(m1-common)
|
||||||
|
// FILE: jvm.kt
|
||||||
|
interface MyMap<K, V> {
|
||||||
|
val values: Collection<V>
|
||||||
|
}
|
||||||
|
|
||||||
|
actual typealias MyHashMap<K, V> = MyHashMapJava<K, V>
|
||||||
|
|
||||||
|
// FILE: MyHashMapJava.java
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public final class MyHashMapJava<K, V> extends AbstractMyHashMap<K, V> {
|
||||||
|
// fake override of field AbstractMyHashMap.values
|
||||||
|
}
|
||||||
|
abstract class AbstractMyHashMap<K, V> implements MyMap<K, V> {
|
||||||
|
protected Collection<V> values;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<V> getValues() {
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -26551,6 +26551,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideInJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("propertyAgainstFakeOverrideOfJavaField.kt")
|
||||||
|
public void testPropertyAgainstFakeOverrideOfJavaField() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstFakeOverrideOfJavaField.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyAgainstJavaMethod.kt")
|
@TestMetadata("propertyAgainstJavaMethod.kt")
|
||||||
public void testPropertyAgainstJavaMethod() throws Exception {
|
public void testPropertyAgainstJavaMethod() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user