Avoid non-null assertions for inline classes based on nullable types

Note that there are more places where assertions for inline classes should refined:
  - lateinit vars
  - values that come from Java
  - type casts (interfaces to inline class type)
This commit is contained in:
Mikhail Zarechenskiy
2018-02-20 12:46:14 +03:00
parent e3c58eced1
commit f23b5103ec
11 changed files with 115 additions and 15 deletions
@@ -1947,6 +1947,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("assertionsForParametersOfInlineClassTypes.kt")
public void testAssertionsForParametersOfInlineClassTypes() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inlineClasses/assertionsForParametersOfInlineClassTypes.kt");
doTest(fileName);
}
@TestMetadata("boxInlineClassesOnPassingToVarargs.kt")
public void testBoxInlineClassesOnPassingToVarargs() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassesOnPassingToVarargs.kt");
@@ -2049,6 +2055,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("noAssertionsForInlineClassesBasedOnNullableTypes.kt")
public void testNoAssertionsForInlineClassesBasedOnNullableTypes() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inlineClasses/noAssertionsForInlineClassesBasedOnNullableTypes.kt");
doTest(fileName);
}
@TestMetadata("passInlineClassesWithSpreadOperatorToVarargs.kt")
public void testPassInlineClassesWithSpreadOperatorToVarargs() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt");