Files
kotlin/compiler/testData/codegen/boxWithJava/collections/charSequence/J.java
Denis Zharkov 89ded4ab1d Implement hack to support both remove() and removeAt() in MutableList<Int>
Also add couple of tests about CharSequence.get
2015-10-11 19:57:22 +03:00

24 lines
531 B
Java
Vendored

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";
}
}