Fix mutable collection stub methods generation for corner case

The problem is that
`override fun remove(element: E): CollectionWithRemove<E>`
seems to be illegal from Java's point of view, while it's OK for JVM

These declarations have the same signature (return type is isgnored)
- override fun remove(element: E): CollectionWithRemove<E>
- override fun remove(element: E): Boolean

When we meet such declaration we choose random declaration for fake override in synthetic class
that may lead to signature clash
This commit is contained in:
Denis Zharkov
2016-06-23 16:14:51 +03:00
parent 47e1ff34f0
commit 1780f57265
7 changed files with 209 additions and 2 deletions
@@ -1276,12 +1276,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("customReadOnlyIterator.kt")
public void testCustomReadOnlyIterator() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/customReadOnlyIterator.kt");
doTest(fileName);
}
@TestMetadata("delegationToArrayList.kt")
public void testDelegationToArrayList() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/delegationToArrayList.kt");
doTest(fileName);
}
@TestMetadata("immutableRemove.kt")
public void testImmutableRemove() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/immutableRemove.kt");
doTest(fileName);
}
@TestMetadata("implementationInTrait.kt")
public void testImplementationInTrait() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt");