Implement hack to support both remove() and removeAt() in MutableList<Int>

Also add couple of tests about CharSequence.get
This commit is contained in:
Denis Zharkov
2015-10-10 20:49:18 +03:00
parent 742a538aed
commit 89ded4ab1d
10 changed files with 320 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
import java.util.*;
public class J {
public static class B extends A {
public char get(int index) {
if (index == 1) return 'a';
return super.get(index);
}
}
public static String foo() {
B b = new B();
CharSequence cs = (CharSequence) b;
if (cs.charAt(0) != 'z') return "fail 1";
if (b.get(0) != 'z') return "fail 2";
if (cs.charAt(1) != 'a') return "fail 3";
if (b.get(1) != 'a') return "fail 4";
return "OK";
}
}