mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
Implement hack to support both remove() and removeAt() in MutableList<Int>
Also add couple of tests about CharSequence.get
This commit is contained in:
24
compiler/testData/codegen/boxWithJava/collections/charSequence/J.java
vendored
Normal file
24
compiler/testData/codegen/boxWithJava/collections/charSequence/J.java
vendored
Normal 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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user