Support loading builtin methods from Java with different names

This commit is contained in:
Denis Zharkov
2015-10-10 18:47:18 +03:00
parent 3f5498e9f5
commit 742a538aed
11 changed files with 413 additions and 16 deletions
@@ -0,0 +1,22 @@
// FILE: A.java
abstract public class A<F> extends B<F> {
public F remove(int x) { }
public boolean remove(Object x) { }
}
// FILE: main.kt
import java.util.*;
abstract class B<T> : MutableList<T>, AbstractList<T>() {
override fun removeAt(index: Int): T = null!!
override fun remove(o: T): Boolean = null!!
}
fun main(a: A<String>, b: B<String>, c: ArrayList<String>) {
a.remove("")
a.removeAt(0)
b.remove("")
b.removeAt(0)
c.remove("")
c.removeAt(0)
}