EnhancedNullability annotation in IR

Fixes KT-40115 & KT-40117.

Move FlexibleNullability annotation to 'kotlin.internal.ir'.
This commit is contained in:
Dmitry Petrov
2020-08-31 11:04:10 +03:00
parent 0bff406a12
commit 8cb8284957
29 changed files with 514 additions and 178 deletions
@@ -94,11 +94,6 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
runTest("compiler/testData/codegen/bytecodeListing/jvmStaticWithDefaultParameters.kt");
}
@TestMetadata("lateInitNotNull.kt")
public void testLateInitNotNull() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/lateInitNotNull.kt");
}
@TestMetadata("localFunctionInInitBlock.kt")
public void testLocalFunctionInInitBlock() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.kt");
@@ -139,11 +134,6 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
runTest("compiler/testData/codegen/bytecodeListing/noToArrayInJava.kt");
}
@TestMetadata("platformTypes.kt")
public void testPlatformTypes() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/platformTypes.kt");
}
@TestMetadata("privateDefaultImpls.kt")
public void testPrivateDefaultImpls() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/privateDefaultImpls.kt");
@@ -669,6 +659,39 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NullabilityAnnotations extends AbstractBytecodeListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInNullabilityAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("lateInitNotNull.kt")
public void testLateInitNotNull() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/lateInitNotNull.kt");
}
@TestMetadata("nullabilityAnnotationsForReturnType.kt")
public void testNullabilityAnnotationsForReturnType() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/nullabilityAnnotationsForReturnType.kt");
}
@TestMetadata("nullabilityAnnotationsOnDelegatedMembers.kt")
public void testNullabilityAnnotationsOnDelegatedMembers() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/nullabilityAnnotationsOnDelegatedMembers.kt");
}
@TestMetadata("platformTypes.kt")
public void testPlatformTypes() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/platformTypes.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/specialBridges")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -94,11 +94,6 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
runTest("compiler/testData/codegen/bytecodeListing/jvmStaticWithDefaultParameters.kt");
}
@TestMetadata("lateInitNotNull.kt")
public void testLateInitNotNull() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/lateInitNotNull.kt");
}
@TestMetadata("localFunctionInInitBlock.kt")
public void testLocalFunctionInInitBlock() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.kt");
@@ -139,11 +134,6 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
runTest("compiler/testData/codegen/bytecodeListing/noToArrayInJava.kt");
}
@TestMetadata("platformTypes.kt")
public void testPlatformTypes() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/platformTypes.kt");
}
@TestMetadata("privateDefaultImpls.kt")
public void testPrivateDefaultImpls() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/privateDefaultImpls.kt");
@@ -639,6 +629,39 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NullabilityAnnotations extends AbstractIrBytecodeListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInNullabilityAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("lateInitNotNull.kt")
public void testLateInitNotNull() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/lateInitNotNull.kt");
}
@TestMetadata("nullabilityAnnotationsForReturnType.kt")
public void testNullabilityAnnotationsForReturnType() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/nullabilityAnnotationsForReturnType.kt");
}
@TestMetadata("nullabilityAnnotationsOnDelegatedMembers.kt")
public void testNullabilityAnnotationsOnDelegatedMembers() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/nullabilityAnnotationsOnDelegatedMembers.kt");
}
@TestMetadata("platformTypes.kt")
public void testPlatformTypes() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/nullabilityAnnotations/platformTypes.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/specialBridges")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -95,6 +95,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/classes/delegatedImplementation.kt");
}
@TestMetadata("delegatedImplementationOfJavaInterface.kt")
public void testDelegatedImplementationOfJavaInterface() throws Exception {
runTest("compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt");
}
@TestMetadata("delegatedImplementationWithExplicitOverride.kt")
public void testDelegatedImplementationWithExplicitOverride() throws Exception {
runTest("compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt");