JVM_IR fix Java wildcard types translation

Types such as 'Collection<? extends CharSequence>' are treated as
'(kotlin.collections.MutableCollection<out kotlin.CharSequence!>
  ..kotlin.collections.Collection<kotlin.CharSequence!>?)'
by the front-end.
When generating generic signatures, JVM BE takes lower bound (which is
'kotlin.collections.MutableCollection<out kotlin.CharSequence!>').
Emulate this behavior in TypeTranslator.
This commit is contained in:
Dmitry Petrov
2020-10-19 17:28:37 +03:00
parent 19ed04e3fe
commit 47c784f023
16 changed files with 283 additions and 47 deletions
@@ -49,6 +49,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
runTest("compiler/testData/codegen/bytecodeListing/defaultImpls.kt");
}
@TestMetadata("delegationToJavaInterfaceWithWildcardType.kt")
public void testDelegationToJavaInterfaceWithWildcardType() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/delegationToJavaInterfaceWithWildcardType.kt");
}
@TestMetadata("emptyMultifileFacade.kt")
public void testEmptyMultifileFacade() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/emptyMultifileFacade.kt");
@@ -49,6 +49,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
runTest("compiler/testData/codegen/bytecodeListing/defaultImpls.kt");
}
@TestMetadata("delegationToJavaInterfaceWithWildcardType.kt")
public void testDelegationToJavaInterfaceWithWildcardType() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/delegationToJavaInterfaceWithWildcardType.kt");
}
@TestMetadata("emptyMultifileFacade.kt")
public void testEmptyMultifileFacade() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/emptyMultifileFacade.kt");
@@ -2069,6 +2069,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/types/intersectionType3_OI.kt");
}
@TestMetadata("javaWildcardType.kt")
public void testJavaWildcardType() throws Exception {
runTest("compiler/testData/ir/irText/types/javaWildcardType.kt");
}
@TestMetadata("kt36143.kt")
public void testKt36143() throws Exception {
runTest("compiler/testData/ir/irText/types/kt36143.kt");