JVM IR: keep original KotlinType in eraseTypeParameters

Otherwise EnhancedNullability annotation instance is lost (for some
reason it's not translated to IR elements), and in the newly added test,
the wrapper type in Java is confused with primitive, and this causes
a platform declaration clash error.

Also make IrTypeArgument.eraseTypeParameters private, since it's not
used outside.
This commit is contained in:
Alexander Udalov
2020-02-05 16:02:52 +01:00
parent 1ae0017401
commit 763cb6dd6f
6 changed files with 39 additions and 1 deletions
@@ -28169,6 +28169,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/typeMapping"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("enhancedPrimitiveInReturnType.kt")
public void testEnhancedPrimitiveInReturnType() throws Exception {
runTest("compiler/testData/codegen/box/typeMapping/enhancedPrimitiveInReturnType.kt");
}
@TestMetadata("enhancedPrimitives.kt")
public void testEnhancedPrimitives() throws Exception {
runTest("compiler/testData/codegen/box/typeMapping/enhancedPrimitives.kt");