Minor, add test case on SAM conversion over smart cast
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
fun test(a: Any?) {
|
||||
a as () -> Unit
|
||||
Runnable(a).run()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = "Fail"
|
||||
test {
|
||||
result = "OK"
|
||||
}
|
||||
return result
|
||||
}
|
||||
+5
@@ -23336,6 +23336,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/sam"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("castFromAny.kt")
|
||||
public void testCastFromAny() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/castFromAny.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt17091.kt")
|
||||
public void testKt17091() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt17091.kt");
|
||||
|
||||
+5
@@ -23336,6 +23336,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/sam"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("castFromAny.kt")
|
||||
public void testCastFromAny() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/castFromAny.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt17091.kt")
|
||||
public void testKt17091() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt17091.kt");
|
||||
|
||||
+5
@@ -22236,6 +22236,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/sam"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("castFromAny.kt")
|
||||
public void testCastFromAny() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/castFromAny.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt17091.kt")
|
||||
public void testKt17091() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt17091.kt");
|
||||
|
||||
Reference in New Issue
Block a user