[Tests] Add test for KT-65197
^KT-65197
This commit is contained in:
committed by
Space Team
parent
9f8ea3e2e5
commit
112473f310
+6
@@ -5920,6 +5920,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5920,6 +5920,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5897,6 +5897,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5897,6 +5897,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5897,6 +5897,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// WITH_STDLIB
|
||||
// KT-40613
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
// KT-65402
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6
|
||||
// KT-65403
|
||||
// IGNORE_BACKEND: WASM
|
||||
|
||||
private fun <T> some(): T =
|
||||
Some1() as T
|
||||
|
||||
private class Some1
|
||||
|
||||
private class Some2(private val s: String) {
|
||||
fun foo(): String = "Some2: $s"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val some2 = try {
|
||||
some<Some2>()
|
||||
} catch(cce: ClassCastException) {
|
||||
val message = cce.toString()
|
||||
return if (Regex(".*Some1 cannot be cast to .*Some2.*").matches(message))
|
||||
"OK"
|
||||
else
|
||||
message
|
||||
} catch (t: Throwable) {
|
||||
return t.toString()
|
||||
}
|
||||
return some2.foo()
|
||||
}
|
||||
+6
@@ -5897,6 +5897,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5663,6 +5663,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5897,6 +5897,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -5897,6 +5897,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+5
@@ -5138,6 +5138,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/lambdaToUnitCast.kt");
|
||||
|
||||
+6
@@ -4355,6 +4355,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
Generated
+6
@@ -4355,6 +4355,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -4355,6 +4355,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -4355,6 +4355,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -4459,6 +4459,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -4555,6 +4555,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -4363,6 +4363,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
+6
@@ -4460,6 +4460,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
Generated
+6
@@ -4337,6 +4337,12 @@ public class FirWasmJsCodegenBoxTestGenerated extends AbstractFirWasmJsCodegenBo
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
Generated
+6
@@ -4337,6 +4337,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/casts/kt59022.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt65197.kt")
|
||||
public void testKt65197() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/casts/kt65197.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaToUnitCast.kt")
|
||||
public void testLambdaToUnitCast() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user