[FIR] Fix IncDecOperatorsInExpectClass for FIR, add multi-module test
- `IncDecOperatorsInExpectClass.kt` should produce an `ACTUAL_WITHOUT_EXPECT` in K2 (see KT-55177). This went unnoticed because of KT-55570. - A similar multi-module test for K1 and K2 has been added, called: `multiplatform/incDecOperatorsInExpectClass.kt`.
This commit is contained in:
committed by
teamcity
parent
2faa247075
commit
1803bd36cc
+6
@@ -21356,6 +21356,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||||
|
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/incDecOperatorsInExpectClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incompatibles.kt")
|
@TestMetadata("incompatibles.kt")
|
||||||
public void testIncompatibles() throws Exception {
|
public void testIncompatibles() throws Exception {
|
||||||
|
|||||||
+6
@@ -21362,6 +21362,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||||
|
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/incDecOperatorsInExpectClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incompatibles.kt")
|
@TestMetadata("incompatibles.kt")
|
||||||
public void testIncompatibles() throws Exception {
|
public void testIncompatibles() throws Exception {
|
||||||
|
|||||||
+6
@@ -21356,6 +21356,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||||
|
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/incDecOperatorsInExpectClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incompatibles.kt")
|
@TestMetadata("incompatibles.kt")
|
||||||
public void testIncompatibles() throws Exception {
|
public void testIncompatibles() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// In FIR, declaring the same `expect` and `actual` classes in one compiler module is not possible (see KT-55177). Hence the `.fir.kt` test
|
||||||
|
// expects a diagnostic here. The multi-module test corresponding to this test is called: `multiplatform/incDecOperatorsInExpectClass.kt`.
|
||||||
|
|
||||||
|
// !LANGUAGE: +MultiPlatformProjects
|
||||||
|
// SKIP_TXT
|
||||||
|
// Issue: KT-49714
|
||||||
|
|
||||||
|
expect class Counter {
|
||||||
|
operator fun inc(): Counter
|
||||||
|
operator fun dec(): Counter
|
||||||
|
}
|
||||||
|
|
||||||
|
<!ACTUAL_WITHOUT_EXPECT!>actual typealias Counter = Int<!>
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
// FIR_IDENTICAL
|
// In FIR, declaring the same `expect` and `actual` classes in one compiler module is not possible (see KT-55177). Hence the `.fir.kt` test
|
||||||
|
// expects a diagnostic here. The multi-module test corresponding to this test is called: `multiplatform/incDecOperatorsInExpectClass.kt`.
|
||||||
|
|
||||||
// !LANGUAGE: +MultiPlatformProjects
|
// !LANGUAGE: +MultiPlatformProjects
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// Issue: KT-49714
|
// Issue: KT-49714
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// Issue: KT-49714
|
||||||
|
|
||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class Counter {
|
||||||
|
operator fun inc(): Counter
|
||||||
|
operator fun dec(): Counter
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(common)
|
||||||
|
actual typealias Counter = Int
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// -- Module: <common> --
|
||||||
|
package
|
||||||
|
|
||||||
|
public final expect class Counter {
|
||||||
|
public final expect operator fun dec(): Counter
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public final expect operator fun inc(): Counter
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- Module: <main> --
|
||||||
|
package
|
||||||
|
|
||||||
|
public actual typealias Counter = kotlin.Int
|
||||||
Generated
+6
@@ -21362,6 +21362,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("incDecOperatorsInExpectClass.kt")
|
||||||
|
public void testIncDecOperatorsInExpectClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/incDecOperatorsInExpectClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incompatibles.kt")
|
@TestMetadata("incompatibles.kt")
|
||||||
public void testIncompatibles() throws Exception {
|
public void testIncompatibles() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user