Add test for KT-52580
This commit is contained in:
committed by
teamcity
parent
ed8187109a
commit
b73783b693
+6
@@ -44741,6 +44741,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// ISSUE: KT-52580
|
||||
|
||||
interface Base {
|
||||
val a: String
|
||||
}
|
||||
|
||||
interface Derived : Base {
|
||||
override val a: String
|
||||
val b: Int
|
||||
}
|
||||
|
||||
class BaseImpl(override val a: String) : Base
|
||||
|
||||
fun test(base: Base): String {
|
||||
return consume(
|
||||
base.run { a },
|
||||
(base as? Derived)?.b?.toString(),
|
||||
base.a
|
||||
)
|
||||
}
|
||||
|
||||
fun consume(s1: String, s2: String?, s3: String): String {
|
||||
return "$s1|$s2|$s3"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = test(BaseImpl("Base"))
|
||||
return when (result) {
|
||||
"Base|null|Base" -> "OK"
|
||||
else -> "Fail: $result"
|
||||
}
|
||||
}
|
||||
+6
@@ -44171,6 +44171,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
|
||||
+6
@@ -44741,6 +44741,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
|
||||
+5
@@ -35682,6 +35682,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/primitive.kt");
|
||||
|
||||
+6
@@ -32485,6 +32485,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
|
||||
+6
@@ -32587,6 +32587,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
|
||||
+5
@@ -29156,6 +29156,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/primitive.kt");
|
||||
|
||||
+6
@@ -35580,6 +35580,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt4733.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52580.kt")
|
||||
public void testKt52580() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/safeCall/kt52580.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user