[K2] Prohibit smart casts for 'expect' properties

^KT-61340
This commit is contained in:
Anastasia.Nekrasova
2023-09-19 19:03:15 +03:00
committed by Space Team
parent e4ea733482
commit e3bab4a7da
9 changed files with 150 additions and 0 deletions
@@ -1723,6 +1723,28 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/smartCasts")
@TestDataPath("$PROJECT_ROOT")
public class SmartCasts {
@Test
public void testAllFilesPresentInSmartCasts() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/smartCasts"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("kt61340_commonCode.kt")
public void testKt61340_commonCode() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/smartCasts/kt61340_commonCode.kt");
}
@Test
@TestMetadata("kt61340_platformCode.kt")
public void testKt61340_platformCode() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/smartCasts/kt61340_platformCode.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/topLevelFun")
@TestDataPath("$PROJECT_ROOT")
@@ -1723,6 +1723,28 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/smartCasts")
@TestDataPath("$PROJECT_ROOT")
public class SmartCasts {
@Test
public void testAllFilesPresentInSmartCasts() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/smartCasts"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("kt61340_commonCode.kt")
public void testKt61340_commonCode() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/smartCasts/kt61340_commonCode.kt");
}
@Test
@TestMetadata("kt61340_platformCode.kt")
public void testKt61340_platformCode() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/smartCasts/kt61340_platformCode.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/topLevelFun")
@TestDataPath("$PROJECT_ROOT")