Fix inheritance from mutable Java collections

Don't use CodegenUtil#getDeclaredFunctionByRawSignature because it's incorrect
in case of platform types. Instead use JetTypeMapper to find JVM signatures of
methods which are callable on the current class

 #KT-6042 Fixed
This commit is contained in:
Alexander Udalov
2014-10-20 15:09:22 +04:00
parent 07374b5638
commit fb5806f5fb
3 changed files with 83 additions and 58 deletions
@@ -0,0 +1,24 @@
// KT-6042 java.lang.UnsupportedOperationException with ArrayList
import java.util.ArrayList
class A : ArrayList<String>()
fun box(): String {
val a = A()
val b = A()
a.addAll(b)
a.addAll(0, b)
a.removeAll(b)
a.retainAll(b)
a.clear()
a.add("")
a.set(0, "")
a.add(0, "")
a.remove(0)
a.remove("")
return "OK"
}