Codegen test for smart cast to Nothing?
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
fun String?.foo() = this ?: "OK"
|
||||||
|
|
||||||
|
fun foo(i: Int?): String {
|
||||||
|
if (i == null) return i.foo()
|
||||||
|
return "$i"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = foo(null)
|
||||||
+6
@@ -7305,6 +7305,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/implicitToGrandSon.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/implicitToGrandSon.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nullSmartCast.kt")
|
||||||
|
public void testNullSmartCast() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/nullSmartCast.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/specialBuiltins")
|
@TestMetadata("compiler/testData/codegen/box/specialBuiltins")
|
||||||
|
|||||||
Reference in New Issue
Block a user