[FE] Cover "implicit actualization"/"actual fake-overrides" KT-58544 with regression tests
Review: https://jetbrains.team/p/kt/reviews/11039/timeline
This commit is contained in:
+24
@@ -20,6 +20,18 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends AbstractFirLightTreeWithActualizerDiagnosticsTest {
|
||||
@Test
|
||||
@TestMetadata("actualFakeOverride.kt")
|
||||
public void testActualFakeOverride() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualFakeOverrideVirtual.kt")
|
||||
public void testActualFakeOverrideVirtual() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualFakeOverrideVirtual.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualTypealiasToSpecialAnnotation.kt")
|
||||
public void testActualTypealiasToSpecialAnnotation() throws Exception {
|
||||
@@ -103,6 +115,18 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitActualFakeOverride_AbstractMap.kt")
|
||||
public void testImplicitActualFakeOverride_AbstractMap() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_AbstractMap.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitActualFakeOverride_simple.kt")
|
||||
public void testImplicitActualFakeOverride_simple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||
|
||||
+24
@@ -20,6 +20,18 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFirPsiWithActualizerDiagnosticsTest {
|
||||
@Test
|
||||
@TestMetadata("actualFakeOverride.kt")
|
||||
public void testActualFakeOverride() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualFakeOverrideVirtual.kt")
|
||||
public void testActualFakeOverrideVirtual() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualFakeOverrideVirtual.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualTypealiasToSpecialAnnotation.kt")
|
||||
public void testActualTypealiasToSpecialAnnotation() throws Exception {
|
||||
@@ -103,6 +115,18 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitActualFakeOverride_AbstractMap.kt")
|
||||
public void testImplicitActualFakeOverride_AbstractMap() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_AbstractMap.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitActualFakeOverride_simple.kt")
|
||||
public void testImplicitActualFakeOverride_simple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class HashMap {
|
||||
val size: Int
|
||||
}
|
||||
|
||||
expect abstract class AbstractMap {
|
||||
val size: Int
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual abstract class AbstractMap() {
|
||||
actual val size: Int = 0
|
||||
}
|
||||
|
||||
actual class HashMap : AbstractMap()
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
interface Map {
|
||||
val size: Int
|
||||
}
|
||||
|
||||
expect class HashMap : Map {
|
||||
override val size: Int
|
||||
}
|
||||
|
||||
expect abstract class AbstractMap : Map {
|
||||
override val size: Int
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual abstract class AbstractMap() : Map {
|
||||
actual override val size: Int = 0
|
||||
}
|
||||
|
||||
actual class HashMap : AbstractMap(), Map
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// WITH_STDLIB
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
// K2: false positve INCOMPATIBLE_MATCHING: KT-60155
|
||||
<!INCOMPATIBLE_MATCHING{JVM}!>public expect abstract class AbstractMutableMap<K, V> : MutableMap<K, V> {
|
||||
override val values: MutableCollection<V>
|
||||
}<!>
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
import java.util.AbstractMap
|
||||
|
||||
public actual abstract class AbstractMutableMap<K, V>() : MutableMap<K, V>, AbstractMap<K, V>()
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// WITH_STDLIB
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
// K2: false positve INCOMPATIBLE_MATCHING: KT-60155
|
||||
public expect abstract class AbstractMutableMap<K, V> : MutableMap<K, V> {
|
||||
override val values: MutableCollection<V>
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
import java.util.AbstractMap
|
||||
|
||||
public actual abstract class AbstractMutableMap<K, V>() : MutableMap<K, V>, AbstractMap<K, V>()
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class Foo {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
interface FooProvider {
|
||||
fun foo(): Int = 42
|
||||
}
|
||||
|
||||
actual class Foo : FooProvider
|
||||
Generated
+24
@@ -22699,6 +22699,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Multiplatform {
|
||||
@Test
|
||||
@TestMetadata("actualFakeOverride.kt")
|
||||
public void testActualFakeOverride() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualFakeOverrideVirtual.kt")
|
||||
public void testActualFakeOverrideVirtual() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/actualFakeOverrideVirtual.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualTypealiasToSpecialAnnotation.kt")
|
||||
public void testActualTypealiasToSpecialAnnotation() throws Exception {
|
||||
@@ -22782,6 +22794,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitActualFakeOverride_AbstractMap.kt")
|
||||
public void testImplicitActualFakeOverride_AbstractMap() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_AbstractMap.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("implicitActualFakeOverride_simple.kt")
|
||||
public void testImplicitActualFakeOverride_simple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implicitActualFakeOverride_simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user