mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +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:
20
compiler/testData/codegen/boxWithJava/collections/removeAtInt/J.java
vendored
Normal file
20
compiler/testData/codegen/boxWithJava/collections/removeAtInt/J.java
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import java.util.*;
|
||||
|
||||
public class J {
|
||||
|
||||
private static class MyList extends A {}
|
||||
|
||||
public static String foo() {
|
||||
MyList myList = new MyList();
|
||||
List<Integer> list = (List<Integer>) myList;
|
||||
|
||||
if (!list.remove((Integer) 1)) return "fail 1";
|
||||
if (list.remove((int) 1) != 123) return "fail 2";
|
||||
|
||||
if (!myList.remove((Integer) 1)) return "fail 3";
|
||||
if (myList.remove((int) 1) != 123) return "fail 4";
|
||||
|
||||
if (myList.removeAt(1) != 123) return "fail 5";
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user