JVM_IR: check for null when converting unboxed inline classes to strings
`C?` can be unboxed into `T?` if if wraps a reference type `T!!`, but in this case `null` is not a valid value to pass to `toString-impl`. #KT-42005 Fixed
This commit is contained in:
+5
@@ -15372,6 +15372,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringOfUnboxedNullable.kt")
|
||||
public void testToStringOfUnboxedNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeChecksForInlineClasses.kt")
|
||||
public void testTypeChecksForInlineClasses() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt");
|
||||
|
||||
+8
-3
@@ -3192,9 +3192,14 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/suspendFunctionMangling.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringIsCalledByInlineClass.kt")
|
||||
public void testToStringIsCalledByInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringIsCalledByInlineClass.kt");
|
||||
@TestMetadata("toStringOfInlineClassValue.kt")
|
||||
public void testToStringOfInlineClassValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfInlineClassValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringOfReferenceInlineClassValue.kt")
|
||||
public void testToStringOfReferenceInlineClassValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfReferenceInlineClassValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("uIntArrayIteratorWithoutBoxing.kt")
|
||||
|
||||
+5
@@ -14669,6 +14669,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/simpleSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringOfUnboxedNullable.kt")
|
||||
public void ignoreToStringOfUnboxedNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt");
|
||||
}
|
||||
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
+5
@@ -13977,6 +13977,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringOfUnboxedNullable.kt")
|
||||
public void testToStringOfUnboxedNullable() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeChecksForInlineClasses.kt")
|
||||
public void testTypeChecksForInlineClasses() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/typeChecksForInlineClasses.kt");
|
||||
|
||||
+8
-3
@@ -3287,9 +3287,14 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/suspendFunctionMangling.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringIsCalledByInlineClass.kt")
|
||||
public void testToStringIsCalledByInlineClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringIsCalledByInlineClass.kt");
|
||||
@TestMetadata("toStringOfInlineClassValue.kt")
|
||||
public void testToStringOfInlineClassValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfInlineClassValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toStringOfReferenceInlineClassValue.kt")
|
||||
public void testToStringOfReferenceInlineClassValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfReferenceInlineClassValue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("uIntArrayIteratorWithoutBoxing.kt")
|
||||
|
||||
Reference in New Issue
Block a user