[TEST] Add test checking cast to DNN type
muted temporary due to required support in backends
This commit is contained in:
committed by
TeamCityServer
parent
5b19c41373
commit
23ad0e7c63
+6
@@ -4352,6 +4352,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: +DefinitelyNonNullableTypes
|
||||
// IGNORE_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun <T> test(t: T) = t as (T & Any)
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
test<Any?>(null)
|
||||
} catch (ex: NullPointerException) {
|
||||
return "FAIL: expected NPE"
|
||||
}
|
||||
return test("OK")
|
||||
}
|
||||
+6
@@ -4280,6 +4280,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
|
||||
+6
@@ -4352,6 +4352,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
|
||||
+5
@@ -3686,6 +3686,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Casts extends AbstractLightAnalysisModeTest {
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void ignoreCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -2834,6 +2834,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt");
|
||||
|
||||
Generated
+5
@@ -2834,6 +2834,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -2824,6 +2824,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt");
|
||||
|
||||
+6
@@ -3152,6 +3152,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/casts/castGenericNull.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("castToDefinitelyNotNullType.kt")
|
||||
public void testCastToDefinitelyNotNullType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/castToDefinitelyNotNullType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontCreateInconsistentTypeDuringStarProjectionSubstitution.kt")
|
||||
public void testDontCreateInconsistentTypeDuringStarProjectionSubstitution() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user